5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/MailingComponent.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:0a36b87bc4baaec899f666c22187a071)
13 * Database access object for the MailingComponent entity.
15 class CRM_Mailing_DAO_MailingComponent
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_mailing_component';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
37 * The name of this component
48 public $component_type;
56 * Body of the component in html format.
63 * Body of the component in text format.
70 * Is this the default component for this component_type?
77 * Is this property active?
86 public function __construct() {
87 $this->__table
= 'civicrm_mailing_component';
88 parent
::__construct();
92 * Returns localized title of this entity.
94 public static function getEntityTitle() {
95 return ts('Mailing Components');
99 * Returns all the column names of this table
103 public static function &fields() {
104 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
105 Civi
::$statics[__CLASS__
]['fields'] = [
108 'type' => CRM_Utils_Type
::T_INT
,
109 'title' => ts('Mailing Component ID'),
111 'where' => 'civicrm_mailing_component.id',
112 'table_name' => 'civicrm_mailing_component',
113 'entity' => 'MailingComponent',
114 'bao' => 'CRM_Mailing_BAO_MailingComponent',
119 'type' => CRM_Utils_Type
::T_STRING
,
120 'title' => ts('Component Name'),
121 'description' => ts('The name of this component'),
123 'size' => CRM_Utils_Type
::BIG
,
124 'where' => 'civicrm_mailing_component.name',
125 'table_name' => 'civicrm_mailing_component',
126 'entity' => 'MailingComponent',
127 'bao' => 'CRM_Mailing_BAO_MailingComponent',
130 'component_type' => [
131 'name' => 'component_type',
132 'type' => CRM_Utils_Type
::T_STRING
,
133 'title' => ts('Mailing Component Type'),
134 'description' => ts('Type of Component.'),
136 'size' => CRM_Utils_Type
::TWELVE
,
137 'where' => 'civicrm_mailing_component.component_type',
138 'table_name' => 'civicrm_mailing_component',
139 'entity' => 'MailingComponent',
140 'bao' => 'CRM_Mailing_BAO_MailingComponent',
145 'pseudoconstant' => [
146 'callback' => 'CRM_Core_SelectValues::mailingComponents',
151 'type' => CRM_Utils_Type
::T_STRING
,
152 'title' => ts('Subject'),
154 'size' => CRM_Utils_Type
::HUGE
,
155 'where' => 'civicrm_mailing_component.subject',
156 'table_name' => 'civicrm_mailing_component',
157 'entity' => 'MailingComponent',
158 'bao' => 'CRM_Mailing_BAO_MailingComponent',
162 'name' => 'body_html',
163 'type' => CRM_Utils_Type
::T_TEXT
,
164 'title' => ts('Mailing Component Body HTML'),
165 'description' => ts('Body of the component in html format.'),
168 'where' => 'civicrm_mailing_component.body_html',
169 'table_name' => 'civicrm_mailing_component',
170 'entity' => 'MailingComponent',
171 'bao' => 'CRM_Mailing_BAO_MailingComponent',
174 'type' => 'TextArea',
178 'name' => 'body_text',
179 'type' => CRM_Utils_Type
::T_TEXT
,
180 'title' => ts('Body Text'),
181 'description' => ts('Body of the component in text format.'),
184 'where' => 'civicrm_mailing_component.body_text',
185 'table_name' => 'civicrm_mailing_component',
186 'entity' => 'MailingComponent',
187 'bao' => 'CRM_Mailing_BAO_MailingComponent',
190 'type' => 'TextArea',
194 'name' => 'is_default',
195 'type' => CRM_Utils_Type
::T_BOOLEAN
,
196 'title' => ts('Mailing Component is Default?'),
197 'description' => ts('Is this the default component for this component_type?'),
198 'where' => 'civicrm_mailing_component.is_default',
200 'table_name' => 'civicrm_mailing_component',
201 'entity' => 'MailingComponent',
202 'bao' => 'CRM_Mailing_BAO_MailingComponent',
206 'name' => 'is_active',
207 'type' => CRM_Utils_Type
::T_BOOLEAN
,
208 'title' => ts('Mailing Component Is Active?'),
209 'description' => ts('Is this property active?'),
210 'where' => 'civicrm_mailing_component.is_active',
211 'table_name' => 'civicrm_mailing_component',
212 'entity' => 'MailingComponent',
213 'bao' => 'CRM_Mailing_BAO_MailingComponent',
217 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
219 return Civi
::$statics[__CLASS__
]['fields'];
223 * Return a mapping from field-name to the corresponding key (as used in fields()).
226 * Array(string $name => string $uniqueName).
228 public static function &fieldKeys() {
229 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
230 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
232 return Civi
::$statics[__CLASS__
]['fieldKeys'];
236 * Returns the names of this table
240 public static function getTableName() {
241 return self
::$_tableName;
245 * Returns if this table needs to be logged
249 public function getLog() {
254 * Returns the list of fields that can be imported
256 * @param bool $prefix
260 public static function &import($prefix = FALSE) {
261 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_component', $prefix, []);
266 * Returns the list of fields that can be exported
268 * @param bool $prefix
272 public static function &export($prefix = FALSE) {
273 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_component', $prefix, []);
278 * Returns the list of indices
280 * @param bool $localize
284 public static function indices($localize = TRUE) {
286 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;