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:41af94f2313c33bb228194f142fc8e0b)
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
= '';
18 const COMPONENT
= 'CiviMail';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_mailing_component';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = FALSE;
40 * The name of this component
51 public $component_type;
59 * Body of the component in html format.
66 * Body of the component in text format.
73 * Is this the default component for this component_type?
80 * Is this property active?
89 public function __construct() {
90 $this->__table
= 'civicrm_mailing_component';
91 parent
::__construct();
95 * Returns localized title of this entity.
98 * Whether to return the plural version of the title.
100 public static function getEntityTitle($plural = FALSE) {
101 return $plural ?
ts('Mailing Components') : ts('Mailing Component');
105 * Returns all the column names of this table
109 public static function &fields() {
110 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
111 Civi
::$statics[__CLASS__
]['fields'] = [
114 'type' => CRM_Utils_Type
::T_INT
,
115 'title' => ts('Mailing Component ID'),
117 'where' => 'civicrm_mailing_component.id',
118 'table_name' => 'civicrm_mailing_component',
119 'entity' => 'MailingComponent',
120 'bao' => 'CRM_Mailing_BAO_MailingComponent',
130 'type' => CRM_Utils_Type
::T_STRING
,
131 'title' => ts('Component Name'),
132 'description' => ts('The name of this component'),
134 'size' => CRM_Utils_Type
::BIG
,
135 'where' => 'civicrm_mailing_component.name',
136 'table_name' => 'civicrm_mailing_component',
137 'entity' => 'MailingComponent',
138 'bao' => 'CRM_Mailing_BAO_MailingComponent',
142 'component_type' => [
143 'name' => 'component_type',
144 'type' => CRM_Utils_Type
::T_STRING
,
145 'title' => ts('Mailing Component Type'),
146 'description' => ts('Type of Component.'),
148 'size' => CRM_Utils_Type
::TWELVE
,
149 'where' => 'civicrm_mailing_component.component_type',
150 'table_name' => 'civicrm_mailing_component',
151 'entity' => 'MailingComponent',
152 'bao' => 'CRM_Mailing_BAO_MailingComponent',
157 'pseudoconstant' => [
158 'callback' => 'CRM_Core_SelectValues::mailingComponents',
164 'type' => CRM_Utils_Type
::T_STRING
,
165 'title' => ts('Subject'),
167 'size' => CRM_Utils_Type
::HUGE
,
168 'where' => 'civicrm_mailing_component.subject',
169 'table_name' => 'civicrm_mailing_component',
170 'entity' => 'MailingComponent',
171 'bao' => 'CRM_Mailing_BAO_MailingComponent',
174 'label' => ts("Subject"),
179 'name' => 'body_html',
180 'type' => CRM_Utils_Type
::T_TEXT
,
181 'title' => ts('Mailing Component Body HTML'),
182 'description' => ts('Body of the component in html format.'),
185 'where' => 'civicrm_mailing_component.body_html',
186 'table_name' => 'civicrm_mailing_component',
187 'entity' => 'MailingComponent',
188 'bao' => 'CRM_Mailing_BAO_MailingComponent',
191 'type' => 'TextArea',
196 'name' => 'body_text',
197 'type' => CRM_Utils_Type
::T_TEXT
,
198 'title' => ts('Body Text'),
199 'description' => ts('Body of the component in text format.'),
202 'where' => 'civicrm_mailing_component.body_text',
203 'table_name' => 'civicrm_mailing_component',
204 'entity' => 'MailingComponent',
205 'bao' => 'CRM_Mailing_BAO_MailingComponent',
208 'type' => 'TextArea',
209 'label' => ts("Body in Text Format"),
214 'name' => 'is_default',
215 'type' => CRM_Utils_Type
::T_BOOLEAN
,
216 'title' => ts('Mailing Component is Default?'),
217 'description' => ts('Is this the default component for this component_type?'),
218 'where' => 'civicrm_mailing_component.is_default',
220 'table_name' => 'civicrm_mailing_component',
221 'entity' => 'MailingComponent',
222 'bao' => 'CRM_Mailing_BAO_MailingComponent',
227 'name' => 'is_active',
228 'type' => CRM_Utils_Type
::T_BOOLEAN
,
229 'title' => ts('Mailing Component Is Active?'),
230 'description' => ts('Is this property active?'),
231 'where' => 'civicrm_mailing_component.is_active',
232 'table_name' => 'civicrm_mailing_component',
233 'entity' => 'MailingComponent',
234 'bao' => 'CRM_Mailing_BAO_MailingComponent',
239 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
241 return Civi
::$statics[__CLASS__
]['fields'];
245 * Return a mapping from field-name to the corresponding key (as used in fields()).
248 * Array(string $name => string $uniqueName).
250 public static function &fieldKeys() {
251 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
252 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
254 return Civi
::$statics[__CLASS__
]['fieldKeys'];
258 * Returns the names of this table
262 public static function getTableName() {
263 return self
::$_tableName;
267 * Returns if this table needs to be logged
271 public function getLog() {
276 * Returns the list of fields that can be imported
278 * @param bool $prefix
282 public static function &import($prefix = FALSE) {
283 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_component', $prefix, []);
288 * Returns the list of fields that can be exported
290 * @param bool $prefix
294 public static function &export($prefix = FALSE) {
295 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_component', $prefix, []);
300 * Returns the list of indices
302 * @param bool $localize
306 public static function indices($localize = TRUE) {
308 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;