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