Merge pull request #22992 from eileenmcnaughton/billingnot
[civicrm-core.git] / CRM / Core / DAO / PrintLabel.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
ca5cec67 5 * @copyright CiviCRM LLC https://civicrm.org/licensing
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Core/PrintLabel.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
28979d65 9 * (GenCodeChecksum:2ff186e7860c945a080bd0d8672dee5f)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the PrintLabel entity.
f41f0342 14 */
e501603b 15class CRM_Core_DAO_PrintLabel extends CRM_Core_DAO {
929a1c14
CW
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '4.4';
c3fc2621 18
e501603b 19 /**
f41f0342 20 * Static instance to hold the table name.
e501603b
TO
21 *
22 * @var string
23 */
fa45b5b9 24 public static $_tableName = 'civicrm_print_label';
c3fc2621 25
e501603b 26 /**
f41f0342 27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 28 *
c3fc2621 29 * @var bool
e501603b 30 */
fa45b5b9 31 public static $_log = FALSE;
c3fc2621 32
e501603b 33 /**
28979d65
CW
34 * @var int|string|null
35 * (SQL type: int unsigned)
36 * Note that values will be retrieved from the database as a string.
e501603b
TO
37 */
38 public $id;
c3fc2621 39
e501603b 40 /**
01d214aa 41 * User title for this label layout
e501603b 42 *
28979d65
CW
43 * @var string|null
44 * (SQL type: varchar(255))
45 * Note that values will be retrieved from the database as a string.
e501603b
TO
46 */
47 public $title;
c3fc2621 48
e501603b
TO
49 /**
50 * variable name/programmatic handle for this field.
51 *
28979d65
CW
52 * @var string|null
53 * (SQL type: varchar(255))
54 * Note that values will be retrieved from the database as a string.
e501603b
TO
55 */
56 public $name;
c3fc2621 57
e501603b
TO
58 /**
59 * Description of this label layout
60 *
28979d65
CW
61 * @var string|null
62 * (SQL type: text)
63 * Note that values will be retrieved from the database as a string.
e501603b
TO
64 */
65 public $description;
c3fc2621 66
e501603b
TO
67 /**
68 * This refers to name column of civicrm_option_value row in name_badge option group
69 *
28979d65
CW
70 * @var string|null
71 * (SQL type: varchar(255))
72 * Note that values will be retrieved from the database as a string.
e501603b
TO
73 */
74 public $label_format_name;
c3fc2621 75
e501603b
TO
76 /**
77 * Implicit FK to civicrm_option_value row in NEW label_type option group
78 *
28979d65
CW
79 * @var int|string|null
80 * (SQL type: int unsigned)
81 * Note that values will be retrieved from the database as a string.
e501603b
TO
82 */
83 public $label_type_id;
c3fc2621 84
e501603b
TO
85 /**
86 * contains json encode configurations options
87 *
28979d65
CW
88 * @var string|null
89 * (SQL type: longtext)
90 * Note that values will be retrieved from the database as a string.
e501603b
TO
91 */
92 public $data;
c3fc2621 93
e501603b
TO
94 /**
95 * Is this default?
96 *
28979d65
CW
97 * @var bool|string|null
98 * (SQL type: tinyint)
99 * Note that values will be retrieved from the database as a string.
e501603b
TO
100 */
101 public $is_default;
c3fc2621 102
e501603b
TO
103 /**
104 * Is this option active?
105 *
28979d65
CW
106 * @var bool|string|null
107 * (SQL type: tinyint)
108 * Note that values will be retrieved from the database as a string.
e501603b
TO
109 */
110 public $is_active;
c3fc2621 111
e501603b
TO
112 /**
113 * Is this reserved label?
114 *
28979d65
CW
115 * @var bool|string|null
116 * (SQL type: tinyint)
117 * Note that values will be retrieved from the database as a string.
e501603b
TO
118 */
119 public $is_reserved;
c3fc2621 120
e501603b
TO
121 /**
122 * FK to civicrm_contact, who created this label layout
123 *
28979d65
CW
124 * @var int|string|null
125 * (SQL type: int unsigned)
126 * Note that values will be retrieved from the database as a string.
e501603b
TO
127 */
128 public $created_id;
c3fc2621 129
e501603b 130 /**
f41f0342 131 * Class constructor.
e501603b 132 */
c3fc2621 133 public function __construct() {
e501603b
TO
134 $this->__table = 'civicrm_print_label';
135 parent::__construct();
136 }
c3fc2621 137
449c4e6b
CW
138 /**
139 * Returns localized title of this entity.
7b66c3b5
AH
140 *
141 * @param bool $plural
142 * Whether to return the plural version of the title.
449c4e6b 143 */
7b66c3b5
AH
144 public static function getEntityTitle($plural = FALSE) {
145 return $plural ? ts('Print Labels') : ts('Print Label');
449c4e6b
CW
146 }
147
e501603b 148 /**
f41f0342 149 * Returns foreign keys and entity references.
e501603b
TO
150 *
151 * @return array
152 * [CRM_Core_Reference_Interface]
153 */
c3fc2621 154 public static function getReferenceColumns() {
346aaaba 155 if (!isset(Civi::$statics[__CLASS__]['links'])) {
fa45b5b9 156 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621 157 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'created_id', 'civicrm_contact', 'id');
346aaaba 158 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 159 }
346aaaba 160 return Civi::$statics[__CLASS__]['links'];
e501603b 161 }
c3fc2621 162
e501603b
TO
163 /**
164 * Returns all the column names of this table
165 *
166 * @return array
167 */
c3fc2621 168 public static function &fields() {
346aaaba 169 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
170 Civi::$statics[__CLASS__]['fields'] = [
171 'id' => [
e501603b
TO
172 'name' => 'id',
173 'type' => CRM_Utils_Type::T_INT,
c3fc2621
CW
174 'title' => ts('Print Label ID'),
175 'required' => TRUE,
a36434b9 176 'where' => 'civicrm_print_label.id',
522a26c9 177 'table_name' => 'civicrm_print_label',
178 'entity' => 'PrintLabel',
179 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 180 'localizable' => 0,
2cbbebe8
A
181 'html' => [
182 'type' => 'Number',
183 ],
1fe423d6 184 'readonly' => TRUE,
a9d0587b 185 'add' => '4.4',
c3fc2621
CW
186 ],
187 'title' => [
e501603b
TO
188 'name' => 'title',
189 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 190 'title' => ts('Title'),
01d214aa 191 'description' => ts('User title for this label layout'),
e501603b
TO
192 'maxlength' => 255,
193 'size' => CRM_Utils_Type::HUGE,
a36434b9 194 'where' => 'civicrm_print_label.title',
522a26c9 195 'table_name' => 'civicrm_print_label',
196 'entity' => 'PrintLabel',
197 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 198 'localizable' => 0,
a9d0587b 199 'add' => '4.4',
c3fc2621
CW
200 ],
201 'name' => [
e501603b
TO
202 'name' => 'name',
203 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 204 'title' => ts('Name'),
215b423e 205 'description' => ts('variable name/programmatic handle for this field.'),
e501603b
TO
206 'maxlength' => 255,
207 'size' => CRM_Utils_Type::HUGE,
a36434b9 208 'where' => 'civicrm_print_label.name',
522a26c9 209 'table_name' => 'civicrm_print_label',
210 'entity' => 'PrintLabel',
211 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 212 'localizable' => 0,
a9d0587b 213 'add' => '4.4',
c3fc2621
CW
214 ],
215 'description' => [
e501603b
TO
216 'name' => 'description',
217 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 218 'title' => ts('Description'),
215b423e 219 'description' => ts('Description of this label layout'),
a36434b9 220 'where' => 'civicrm_print_label.description',
522a26c9 221 'table_name' => 'civicrm_print_label',
222 'entity' => 'PrintLabel',
223 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 224 'localizable' => 0,
c23563e3
SL
225 'html' => [
226 'label' => ts("Description"),
227 ],
a9d0587b 228 'add' => '4.4',
c3fc2621
CW
229 ],
230 'label_format_name' => [
e501603b
TO
231 'name' => 'label_format_name',
232 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 233 'title' => ts('Label Format'),
215b423e 234 'description' => ts('This refers to name column of civicrm_option_value row in name_badge option group'),
e501603b
TO
235 'maxlength' => 255,
236 'size' => CRM_Utils_Type::HUGE,
a36434b9 237 'where' => 'civicrm_print_label.label_format_name',
522a26c9 238 'table_name' => 'civicrm_print_label',
239 'entity' => 'PrintLabel',
240 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 241 'localizable' => 0,
c3fc2621 242 'html' => [
e501603b 243 'type' => 'Select',
c3fc2621
CW
244 ],
245 'pseudoconstant' => [
e501603b
TO
246 'optionGroupName' => 'name_badge',
247 'optionEditPath' => 'civicrm/admin/options/name_badge',
e6ca0a57 248 ],
a9d0587b 249 'add' => '4.4',
c3fc2621
CW
250 ],
251 'label_type_id' => [
e501603b
TO
252 'name' => 'label_type_id',
253 'type' => CRM_Utils_Type::T_INT,
c3fc2621 254 'title' => ts('Label Type'),
215b423e 255 'description' => ts('Implicit FK to civicrm_option_value row in NEW label_type option group'),
a36434b9 256 'where' => 'civicrm_print_label.label_type_id',
522a26c9 257 'table_name' => 'civicrm_print_label',
258 'entity' => 'PrintLabel',
259 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 260 'localizable' => 0,
c3fc2621 261 'html' => [
e501603b 262 'type' => 'Select',
c3fc2621
CW
263 ],
264 'pseudoconstant' => [
e501603b
TO
265 'optionGroupName' => 'label_type',
266 'optionEditPath' => 'civicrm/admin/options/label_type',
e6ca0a57 267 ],
a9d0587b 268 'add' => '4.4',
c3fc2621
CW
269 ],
270 'data' => [
e501603b
TO
271 'name' => 'data',
272 'type' => CRM_Utils_Type::T_LONGTEXT,
c3fc2621 273 'title' => ts('Data'),
215b423e 274 'description' => ts('contains json encode configurations options'),
a36434b9 275 'where' => 'civicrm_print_label.data',
522a26c9 276 'table_name' => 'civicrm_print_label',
277 'entity' => 'PrintLabel',
278 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 279 'localizable' => 0,
2a5c9b4d 280 'serialize' => self::SERIALIZE_JSON,
c23563e3
SL
281 'html' => [
282 'label' => ts("Data"),
283 ],
a9d0587b 284 'add' => '4.4',
c3fc2621
CW
285 ],
286 'is_default' => [
e501603b
TO
287 'name' => 'is_default',
288 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 289 'title' => ts('Label is Default?'),
215b423e 290 'description' => ts('Is this default?'),
a36434b9 291 'where' => 'civicrm_print_label.is_default',
e501603b 292 'default' => '1',
522a26c9 293 'table_name' => 'civicrm_print_label',
294 'entity' => 'PrintLabel',
295 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 296 'localizable' => 0,
a9d0587b 297 'add' => '4.4',
c3fc2621
CW
298 ],
299 'is_active' => [
e501603b
TO
300 'name' => 'is_active',
301 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 302 'title' => ts('Label Is Active?'),
215b423e 303 'description' => ts('Is this option active?'),
a36434b9 304 'where' => 'civicrm_print_label.is_active',
e501603b 305 'default' => '1',
522a26c9 306 'table_name' => 'civicrm_print_label',
307 'entity' => 'PrintLabel',
308 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 309 'localizable' => 0,
a9d0587b 310 'add' => '4.4',
c3fc2621
CW
311 ],
312 'is_reserved' => [
e501603b
TO
313 'name' => 'is_reserved',
314 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 315 'title' => ts('Is Label Reserved?'),
215b423e 316 'description' => ts('Is this reserved label?'),
a36434b9 317 'where' => 'civicrm_print_label.is_reserved',
e501603b 318 'default' => '1',
522a26c9 319 'table_name' => 'civicrm_print_label',
320 'entity' => 'PrintLabel',
321 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 322 'localizable' => 0,
a9d0587b 323 'add' => '4.4',
c3fc2621
CW
324 ],
325 'created_id' => [
e501603b
TO
326 'name' => 'created_id',
327 'type' => CRM_Utils_Type::T_INT,
2cbbebe8 328 'title' => ts('Created By Contact ID'),
215b423e 329 'description' => ts('FK to civicrm_contact, who created this label layout'),
a36434b9 330 'where' => 'civicrm_print_label.created_id',
522a26c9 331 'table_name' => 'civicrm_print_label',
332 'entity' => 'PrintLabel',
333 'bao' => 'CRM_Core_DAO_PrintLabel',
6a7e5e5d 334 'localizable' => 0,
e501603b 335 'FKClassName' => 'CRM_Contact_DAO_Contact',
2cbbebe8 336 'html' => [
c23563e3 337 'label' => ts("Created By"),
2cbbebe8 338 ],
a9d0587b 339 'add' => '4.4',
c3fc2621
CW
340 ],
341 ];
346aaaba 342 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 343 }
346aaaba 344 return Civi::$statics[__CLASS__]['fields'];
e501603b 345 }
c3fc2621 346
e501603b 347 /**
bd8e0b14 348 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
349 *
350 * @return array
bd8e0b14 351 * Array(string $name => string $uniqueName).
e501603b 352 */
c3fc2621 353 public static function &fieldKeys() {
bd8e0b14
TO
354 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
355 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 356 }
bd8e0b14 357 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 358 }
c3fc2621 359
e501603b
TO
360 /**
361 * Returns the names of this table
362 *
363 * @return string
364 */
c3fc2621 365 public static function getTableName() {
e501603b
TO
366 return self::$_tableName;
367 }
c3fc2621 368
e501603b
TO
369 /**
370 * Returns if this table needs to be logged
371 *
c3fc2621 372 * @return bool
e501603b 373 */
c3fc2621 374 public function getLog() {
e501603b
TO
375 return self::$_log;
376 }
c3fc2621 377
e501603b
TO
378 /**
379 * Returns the list of fields that can be imported
380 *
381 * @param bool $prefix
382 *
383 * @return array
384 */
c3fc2621
CW
385 public static function &import($prefix = FALSE) {
386 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'print_label', $prefix, []);
60808919 387 return $r;
e501603b 388 }
c3fc2621 389
e501603b
TO
390 /**
391 * Returns the list of fields that can be exported
392 *
393 * @param bool $prefix
394 *
395 * @return array
396 */
c3fc2621
CW
397 public static function &export($prefix = FALSE) {
398 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'print_label', $prefix, []);
60808919 399 return $r;
e501603b 400 }
c3fc2621 401
e7a6b91a
AS
402 /**
403 * Returns the list of indices
c3fc2621
CW
404 *
405 * @param bool $localize
406 *
407 * @return array
e7a6b91a
AS
408 */
409 public static function indices($localize = TRUE) {
c3fc2621 410 $indices = [];
e7a6b91a
AS
411 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
412 }
c3fc2621 413
e501603b 414}