Renamed Mailing Component entity
[civicrm-core.git] / CRM / Mailing / DAO / MailingComponent.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
8c9251b3 5 * @copyright CiviCRM LLC (c) 2004-2018
e501603b 6 *
807f8008 7 * Generated from xml/schema/CRM/Mailing/MailingComponent.xml
e501603b 8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
807f8008 9 * (GenCodeChecksum:08753305769bb8ac8d2824081322af92)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
807f8008 13 * Database access object for the MailingComponent entity.
f41f0342 14 */
807f8008 15class CRM_Mailing_DAO_MailingComponent extends CRM_Core_DAO {
c3fc2621 16
e501603b 17 /**
f41f0342 18 * Static instance to hold the table name.
e501603b
TO
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_mailing_component';
c3fc2621 23
e501603b 24 /**
f41f0342 25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 26 *
c3fc2621 27 * @var bool
e501603b 28 */
c3fc2621
CW
29 static $_log = FALSE;
30
e501603b 31 /**
e501603b
TO
32 * @var int unsigned
33 */
34 public $id;
c3fc2621 35
e501603b
TO
36 /**
37 * The name of this component
38 *
39 * @var string
40 */
41 public $name;
c3fc2621 42
e501603b
TO
43 /**
44 * Type of Component.
45 *
46 * @var string
47 */
48 public $component_type;
c3fc2621 49
e501603b 50 /**
e501603b
TO
51 * @var string
52 */
53 public $subject;
c3fc2621 54
e501603b
TO
55 /**
56 * Body of the component in html format.
57 *
58 * @var text
59 */
60 public $body_html;
c3fc2621 61
e501603b
TO
62 /**
63 * Body of the component in text format.
64 *
65 * @var text
66 */
67 public $body_text;
c3fc2621 68
e501603b
TO
69 /**
70 * Is this the default component for this component_type?
71 *
72 * @var boolean
73 */
74 public $is_default;
c3fc2621 75
e501603b
TO
76 /**
77 * Is this property active?
78 *
79 * @var boolean
80 */
81 public $is_active;
c3fc2621 82
e501603b 83 /**
f41f0342 84 * Class constructor.
e501603b 85 */
c3fc2621 86 public function __construct() {
e501603b
TO
87 $this->__table = 'civicrm_mailing_component';
88 parent::__construct();
89 }
c3fc2621 90
e501603b
TO
91 /**
92 * Returns all the column names of this table
93 *
94 * @return array
95 */
c3fc2621 96 public static function &fields() {
346aaaba 97 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
98 Civi::$statics[__CLASS__]['fields'] = [
99 'id' => [
e501603b
TO
100 'name' => 'id',
101 'type' => CRM_Utils_Type::T_INT,
c3fc2621
CW
102 'title' => ts('Mailing Component ID'),
103 'required' => TRUE,
522a26c9 104 'table_name' => 'civicrm_mailing_component',
807f8008
PN
105 'entity' => 'MailingComponent',
106 'bao' => 'CRM_Mailing_DAO_MailingComponent',
6a7e5e5d 107 'localizable' => 0,
c3fc2621
CW
108 ],
109 'name' => [
e501603b
TO
110 'name' => 'name',
111 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 112 'title' => ts('Component Name'),
e501603b
TO
113 'description' => 'The name of this component',
114 'maxlength' => 64,
115 'size' => CRM_Utils_Type::BIG,
522a26c9 116 'table_name' => 'civicrm_mailing_component',
807f8008
PN
117 'entity' => 'MailingComponent',
118 'bao' => 'CRM_Mailing_DAO_MailingComponent',
6a7e5e5d 119 'localizable' => 0,
c3fc2621
CW
120 ],
121 'component_type' => [
e501603b
TO
122 'name' => 'component_type',
123 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 124 'title' => ts('Mailing Component Type'),
e501603b
TO
125 'description' => 'Type of Component.',
126 'maxlength' => 12,
127 'size' => CRM_Utils_Type::TWELVE,
522a26c9 128 'table_name' => 'civicrm_mailing_component',
807f8008
PN
129 'entity' => 'MailingComponent',
130 'bao' => 'CRM_Mailing_DAO_MailingComponent',
6a7e5e5d 131 'localizable' => 0,
c3fc2621 132 'html' => [
e501603b 133 'type' => 'Select',
c3fc2621
CW
134 ],
135 'pseudoconstant' => [
e501603b 136 'callback' => 'CRM_Core_SelectValues::mailingComponents',
c3fc2621
CW
137 ]
138 ],
139 'subject' => [
e501603b
TO
140 'name' => 'subject',
141 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 142 'title' => ts('Subject'),
e501603b
TO
143 'maxlength' => 255,
144 'size' => CRM_Utils_Type::HUGE,
522a26c9 145 'table_name' => 'civicrm_mailing_component',
807f8008
PN
146 'entity' => 'MailingComponent',
147 'bao' => 'CRM_Mailing_DAO_MailingComponent',
6a7e5e5d 148 'localizable' => 0,
c3fc2621
CW
149 ],
150 'body_html' => [
e501603b
TO
151 'name' => 'body_html',
152 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 153 'title' => ts('Mailing Component Body HTML'),
e501603b
TO
154 'description' => 'Body of the component in html format.',
155 'rows' => 8,
156 'cols' => 80,
522a26c9 157 'table_name' => 'civicrm_mailing_component',
807f8008
PN
158 'entity' => 'MailingComponent',
159 'bao' => 'CRM_Mailing_DAO_MailingComponent',
6a7e5e5d 160 'localizable' => 0,
c3fc2621 161 'html' => [
e501603b 162 'type' => 'TextArea',
c3fc2621
CW
163 ],
164 ],
165 'body_text' => [
e501603b
TO
166 'name' => 'body_text',
167 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 168 'title' => ts('Body Text'),
e501603b
TO
169 'description' => 'Body of the component in text format.',
170 'rows' => 8,
171 'cols' => 80,
522a26c9 172 'table_name' => 'civicrm_mailing_component',
807f8008
PN
173 'entity' => 'MailingComponent',
174 'bao' => 'CRM_Mailing_DAO_MailingComponent',
6a7e5e5d 175 'localizable' => 0,
c3fc2621 176 'html' => [
e501603b 177 'type' => 'TextArea',
c3fc2621
CW
178 ],
179 ],
180 'is_default' => [
e501603b
TO
181 'name' => 'is_default',
182 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 183 'title' => ts('Mailing Component is Default?'),
e501603b 184 'description' => 'Is this the default component for this component_type?',
45a83e42 185 'default' => '0',
522a26c9 186 'table_name' => 'civicrm_mailing_component',
807f8008
PN
187 'entity' => 'MailingComponent',
188 'bao' => 'CRM_Mailing_DAO_MailingComponent',
6a7e5e5d 189 'localizable' => 0,
c3fc2621
CW
190 ],
191 'is_active' => [
e501603b
TO
192 'name' => 'is_active',
193 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 194 'title' => ts('Mailing Component Is Active?'),
e501603b 195 'description' => 'Is this property active?',
522a26c9 196 'table_name' => 'civicrm_mailing_component',
807f8008
PN
197 'entity' => 'MailingComponent',
198 'bao' => 'CRM_Mailing_DAO_MailingComponent',
6a7e5e5d 199 'localizable' => 0,
c3fc2621
CW
200 ],
201 ];
346aaaba 202 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 203 }
346aaaba 204 return Civi::$statics[__CLASS__]['fields'];
e501603b 205 }
c3fc2621 206
e501603b 207 /**
bd8e0b14 208 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
209 *
210 * @return array
bd8e0b14 211 * Array(string $name => string $uniqueName).
e501603b 212 */
c3fc2621 213 public static function &fieldKeys() {
bd8e0b14
TO
214 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
215 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 216 }
bd8e0b14 217 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 218 }
c3fc2621 219
e501603b
TO
220 /**
221 * Returns the names of this table
222 *
223 * @return string
224 */
c3fc2621 225 public static function getTableName() {
e501603b
TO
226 return self::$_tableName;
227 }
c3fc2621 228
e501603b
TO
229 /**
230 * Returns if this table needs to be logged
231 *
c3fc2621 232 * @return bool
e501603b 233 */
c3fc2621 234 public function getLog() {
e501603b
TO
235 return self::$_log;
236 }
c3fc2621 237
e501603b
TO
238 /**
239 * Returns the list of fields that can be imported
240 *
241 * @param bool $prefix
242 *
243 * @return array
244 */
c3fc2621
CW
245 public static function &import($prefix = FALSE) {
246 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_component', $prefix, []);
60808919 247 return $r;
e501603b 248 }
c3fc2621 249
e501603b
TO
250 /**
251 * Returns the list of fields that can be exported
252 *
253 * @param bool $prefix
254 *
255 * @return array
256 */
c3fc2621
CW
257 public static function &export($prefix = FALSE) {
258 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_component', $prefix, []);
60808919 259 return $r;
e501603b 260 }
c3fc2621 261
e7a6b91a
AS
262 /**
263 * Returns the list of indices
c3fc2621
CW
264 *
265 * @param bool $localize
266 *
267 * @return array
e7a6b91a
AS
268 */
269 public static function indices($localize = TRUE) {
c3fc2621 270 $indices = [];
e7a6b91a
AS
271 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
272 }
c3fc2621 273
e501603b 274}