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:bb6ab1e7538409ecfa1e72a45bb287a1)
13 * Database access object for the MailingComponent entity.
15 class CRM_Mailing_DAO_MailingComponent
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_mailing_component';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
39 * The name of this component
50 public $component_type;
58 * Body of the component in html format.
65 * Body of the component in text format.
72 * Is this the default component for this component_type?
79 * Is this property active?
88 public function __construct() {
89 $this->__table
= 'civicrm_mailing_component';
90 parent
::__construct();
94 * Returns localized title of this entity.
97 * Whether to return the plural version of the title.
99 public static function getEntityTitle($plural = FALSE) {
100 return $plural ?
ts('Mailing Components') : ts('Mailing Component');
104 * Returns all the column names of this table
108 public static function &fields() {
109 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
110 Civi
::$statics[__CLASS__
]['fields'] = [
113 'type' => CRM_Utils_Type
::T_INT
,
114 'title' => ts('Mailing Component ID'),
116 'where' => 'civicrm_mailing_component.id',
117 'table_name' => 'civicrm_mailing_component',
118 'entity' => 'MailingComponent',
119 'bao' => 'CRM_Mailing_BAO_MailingComponent',
125 'type' => CRM_Utils_Type
::T_STRING
,
126 'title' => ts('Component Name'),
127 'description' => ts('The name of this component'),
129 'size' => CRM_Utils_Type
::BIG
,
130 'where' => 'civicrm_mailing_component.name',
131 'table_name' => 'civicrm_mailing_component',
132 'entity' => 'MailingComponent',
133 'bao' => 'CRM_Mailing_BAO_MailingComponent',
137 'component_type' => [
138 'name' => 'component_type',
139 'type' => CRM_Utils_Type
::T_STRING
,
140 'title' => ts('Mailing Component Type'),
141 'description' => ts('Type of Component.'),
143 'size' => CRM_Utils_Type
::TWELVE
,
144 'where' => 'civicrm_mailing_component.component_type',
145 'table_name' => 'civicrm_mailing_component',
146 'entity' => 'MailingComponent',
147 'bao' => 'CRM_Mailing_BAO_MailingComponent',
152 'pseudoconstant' => [
153 'callback' => 'CRM_Core_SelectValues::mailingComponents',
159 'type' => CRM_Utils_Type
::T_STRING
,
160 'title' => ts('Subject'),
162 'size' => CRM_Utils_Type
::HUGE
,
163 'where' => 'civicrm_mailing_component.subject',
164 'table_name' => 'civicrm_mailing_component',
165 'entity' => 'MailingComponent',
166 'bao' => 'CRM_Mailing_BAO_MailingComponent',
171 'name' => 'body_html',
172 'type' => CRM_Utils_Type
::T_TEXT
,
173 'title' => ts('Mailing Component Body HTML'),
174 'description' => ts('Body of the component in html format.'),
177 'where' => 'civicrm_mailing_component.body_html',
178 'table_name' => 'civicrm_mailing_component',
179 'entity' => 'MailingComponent',
180 'bao' => 'CRM_Mailing_BAO_MailingComponent',
183 'type' => 'TextArea',
188 'name' => 'body_text',
189 'type' => CRM_Utils_Type
::T_TEXT
,
190 'title' => ts('Body Text'),
191 'description' => ts('Body of the component in text format.'),
194 'where' => 'civicrm_mailing_component.body_text',
195 'table_name' => 'civicrm_mailing_component',
196 'entity' => 'MailingComponent',
197 'bao' => 'CRM_Mailing_BAO_MailingComponent',
200 'type' => 'TextArea',
205 'name' => 'is_default',
206 'type' => CRM_Utils_Type
::T_BOOLEAN
,
207 'title' => ts('Mailing Component is Default?'),
208 'description' => ts('Is this the default component for this component_type?'),
209 'where' => 'civicrm_mailing_component.is_default',
211 'table_name' => 'civicrm_mailing_component',
212 'entity' => 'MailingComponent',
213 'bao' => 'CRM_Mailing_BAO_MailingComponent',
218 'name' => 'is_active',
219 'type' => CRM_Utils_Type
::T_BOOLEAN
,
220 'title' => ts('Mailing Component Is Active?'),
221 'description' => ts('Is this property active?'),
222 'where' => 'civicrm_mailing_component.is_active',
223 'table_name' => 'civicrm_mailing_component',
224 'entity' => 'MailingComponent',
225 'bao' => 'CRM_Mailing_BAO_MailingComponent',
230 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
232 return Civi
::$statics[__CLASS__
]['fields'];
236 * Return a mapping from field-name to the corresponding key (as used in fields()).
239 * Array(string $name => string $uniqueName).
241 public static function &fieldKeys() {
242 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
243 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
245 return Civi
::$statics[__CLASS__
]['fieldKeys'];
249 * Returns the names of this table
253 public static function getTableName() {
254 return self
::$_tableName;
258 * Returns if this table needs to be logged
262 public function getLog() {
267 * Returns the list of fields that can be imported
269 * @param bool $prefix
273 public static function &import($prefix = FALSE) {
274 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_component', $prefix, []);
279 * Returns the list of fields that can be exported
281 * @param bool $prefix
285 public static function &export($prefix = FALSE) {
286 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_component', $prefix, []);
291 * Returns the list of indices
293 * @param bool $localize
297 public static function indices($localize = TRUE) {
299 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;