Merge pull request #14326 from civicrm/5.14
[civicrm-core.git] / CRM / Core / DAO / PrintLabel.php
... / ...
CommitLineData
1<?php
2
3/**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Core/PrintLabel.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:2bf1df61a7093242ac2cde0d4d8ef1e0)
10 */
11
12/**
13 * Database access object for the PrintLabel entity.
14 */
15class 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 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 foreign keys and entity references.
116 *
117 * @return array
118 * [CRM_Core_Reference_Interface]
119 */
120 public static function getReferenceColumns() {
121 if (!isset(Civi::$statics[__CLASS__]['links'])) {
122 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
123 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'created_id', 'civicrm_contact', 'id');
124 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
125 }
126 return Civi::$statics[__CLASS__]['links'];
127 }
128
129 /**
130 * Returns all the column names of this table
131 *
132 * @return array
133 */
134 public static function &fields() {
135 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
136 Civi::$statics[__CLASS__]['fields'] = [
137 'id' => [
138 'name' => 'id',
139 'type' => CRM_Utils_Type::T_INT,
140 'title' => ts('Print Label ID'),
141 'required' => TRUE,
142 'where' => 'civicrm_print_label.id',
143 'table_name' => 'civicrm_print_label',
144 'entity' => 'PrintLabel',
145 'bao' => 'CRM_Core_DAO_PrintLabel',
146 'localizable' => 0,
147 ],
148 'title' => [
149 'name' => 'title',
150 'type' => CRM_Utils_Type::T_STRING,
151 'title' => ts('Title'),
152 'description' => ts('User title for for this label layout'),
153 'maxlength' => 255,
154 'size' => CRM_Utils_Type::HUGE,
155 'where' => 'civicrm_print_label.title',
156 'table_name' => 'civicrm_print_label',
157 'entity' => 'PrintLabel',
158 'bao' => 'CRM_Core_DAO_PrintLabel',
159 'localizable' => 0,
160 ],
161 'name' => [
162 'name' => 'name',
163 'type' => CRM_Utils_Type::T_STRING,
164 'title' => ts('Name'),
165 'description' => ts('variable name/programmatic handle for this field.'),
166 'maxlength' => 255,
167 'size' => CRM_Utils_Type::HUGE,
168 'where' => 'civicrm_print_label.name',
169 'table_name' => 'civicrm_print_label',
170 'entity' => 'PrintLabel',
171 'bao' => 'CRM_Core_DAO_PrintLabel',
172 'localizable' => 0,
173 ],
174 'description' => [
175 'name' => 'description',
176 'type' => CRM_Utils_Type::T_TEXT,
177 'title' => ts('Description'),
178 'description' => ts('Description of this label layout'),
179 'where' => 'civicrm_print_label.description',
180 'table_name' => 'civicrm_print_label',
181 'entity' => 'PrintLabel',
182 'bao' => 'CRM_Core_DAO_PrintLabel',
183 'localizable' => 0,
184 ],
185 'label_format_name' => [
186 'name' => 'label_format_name',
187 'type' => CRM_Utils_Type::T_STRING,
188 'title' => ts('Label Format'),
189 'description' => ts('This refers to name column of civicrm_option_value row in name_badge option group'),
190 'maxlength' => 255,
191 'size' => CRM_Utils_Type::HUGE,
192 'where' => 'civicrm_print_label.label_format_name',
193 'table_name' => 'civicrm_print_label',
194 'entity' => 'PrintLabel',
195 'bao' => 'CRM_Core_DAO_PrintLabel',
196 'localizable' => 0,
197 'html' => [
198 'type' => 'Select',
199 ],
200 'pseudoconstant' => [
201 'optionGroupName' => 'name_badge',
202 'optionEditPath' => 'civicrm/admin/options/name_badge',
203 ],
204 ],
205 'label_type_id' => [
206 'name' => 'label_type_id',
207 'type' => CRM_Utils_Type::T_INT,
208 'title' => ts('Label Type'),
209 'description' => ts('Implicit FK to civicrm_option_value row in NEW label_type option group'),
210 'where' => 'civicrm_print_label.label_type_id',
211 'table_name' => 'civicrm_print_label',
212 'entity' => 'PrintLabel',
213 'bao' => 'CRM_Core_DAO_PrintLabel',
214 'localizable' => 0,
215 'html' => [
216 'type' => 'Select',
217 ],
218 'pseudoconstant' => [
219 'optionGroupName' => 'label_type',
220 'optionEditPath' => 'civicrm/admin/options/label_type',
221 ],
222 ],
223 'data' => [
224 'name' => 'data',
225 'type' => CRM_Utils_Type::T_LONGTEXT,
226 'title' => ts('Data'),
227 'description' => ts('contains json encode configurations options'),
228 'where' => 'civicrm_print_label.data',
229 'table_name' => 'civicrm_print_label',
230 'entity' => 'PrintLabel',
231 'bao' => 'CRM_Core_DAO_PrintLabel',
232 'localizable' => 0,
233 'serialize' => self::SERIALIZE_JSON,
234 ],
235 'is_default' => [
236 'name' => 'is_default',
237 'type' => CRM_Utils_Type::T_BOOLEAN,
238 'title' => ts('Label is Default?'),
239 'description' => ts('Is this default?'),
240 'where' => 'civicrm_print_label.is_default',
241 'default' => '1',
242 'table_name' => 'civicrm_print_label',
243 'entity' => 'PrintLabel',
244 'bao' => 'CRM_Core_DAO_PrintLabel',
245 'localizable' => 0,
246 ],
247 'is_active' => [
248 'name' => 'is_active',
249 'type' => CRM_Utils_Type::T_BOOLEAN,
250 'title' => ts('Label Is Active?'),
251 'description' => ts('Is this option active?'),
252 'where' => 'civicrm_print_label.is_active',
253 'default' => '1',
254 'table_name' => 'civicrm_print_label',
255 'entity' => 'PrintLabel',
256 'bao' => 'CRM_Core_DAO_PrintLabel',
257 'localizable' => 0,
258 ],
259 'is_reserved' => [
260 'name' => 'is_reserved',
261 'type' => CRM_Utils_Type::T_BOOLEAN,
262 'title' => ts('Is Label Reserved?'),
263 'description' => ts('Is this reserved label?'),
264 'where' => 'civicrm_print_label.is_reserved',
265 'default' => '1',
266 'table_name' => 'civicrm_print_label',
267 'entity' => 'PrintLabel',
268 'bao' => 'CRM_Core_DAO_PrintLabel',
269 'localizable' => 0,
270 ],
271 'created_id' => [
272 'name' => 'created_id',
273 'type' => CRM_Utils_Type::T_INT,
274 'title' => ts('Label Created By'),
275 'description' => ts('FK to civicrm_contact, who created this label layout'),
276 'where' => 'civicrm_print_label.created_id',
277 'table_name' => 'civicrm_print_label',
278 'entity' => 'PrintLabel',
279 'bao' => 'CRM_Core_DAO_PrintLabel',
280 'localizable' => 0,
281 'FKClassName' => 'CRM_Contact_DAO_Contact',
282 ],
283 ];
284 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
285 }
286 return Civi::$statics[__CLASS__]['fields'];
287 }
288
289 /**
290 * Return a mapping from field-name to the corresponding key (as used in fields()).
291 *
292 * @return array
293 * Array(string $name => string $uniqueName).
294 */
295 public static function &fieldKeys() {
296 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
297 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
298 }
299 return Civi::$statics[__CLASS__]['fieldKeys'];
300 }
301
302 /**
303 * Returns the names of this table
304 *
305 * @return string
306 */
307 public static function getTableName() {
308 return self::$_tableName;
309 }
310
311 /**
312 * Returns if this table needs to be logged
313 *
314 * @return bool
315 */
316 public function getLog() {
317 return self::$_log;
318 }
319
320 /**
321 * Returns the list of fields that can be imported
322 *
323 * @param bool $prefix
324 *
325 * @return array
326 */
327 public static function &import($prefix = FALSE) {
328 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'print_label', $prefix, []);
329 return $r;
330 }
331
332 /**
333 * Returns the list of fields that can be exported
334 *
335 * @param bool $prefix
336 *
337 * @return array
338 */
339 public static function &export($prefix = FALSE) {
340 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'print_label', $prefix, []);
341 return $r;
342 }
343
344 /**
345 * Returns the list of indices
346 *
347 * @param bool $localize
348 *
349 * @return array
350 */
351 public static function indices($localize = TRUE) {
352 $indices = [];
353 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
354 }
355
356}