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