Add titles and icons to entities
[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:e6d0fdaf773f8dec9b1b9282a41788d9)
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 ],
155 'title' => [
156 'name' => 'title',
157 'type' => CRM_Utils_Type::T_STRING,
158 'title' => ts('Title'),
159 'description' => ts('User title for this label layout'),
160 'maxlength' => 255,
161 'size' => CRM_Utils_Type::HUGE,
162 'where' => 'civicrm_print_label.title',
163 'table_name' => 'civicrm_print_label',
164 'entity' => 'PrintLabel',
165 'bao' => 'CRM_Core_DAO_PrintLabel',
166 'localizable' => 0,
167 ],
168 'name' => [
169 'name' => 'name',
170 'type' => CRM_Utils_Type::T_STRING,
171 'title' => ts('Name'),
172 'description' => ts('variable name/programmatic handle for this field.'),
173 'maxlength' => 255,
174 'size' => CRM_Utils_Type::HUGE,
175 'where' => 'civicrm_print_label.name',
176 'table_name' => 'civicrm_print_label',
177 'entity' => 'PrintLabel',
178 'bao' => 'CRM_Core_DAO_PrintLabel',
179 'localizable' => 0,
180 ],
181 'description' => [
182 'name' => 'description',
183 'type' => CRM_Utils_Type::T_TEXT,
184 'title' => ts('Description'),
185 'description' => ts('Description of this label layout'),
186 'where' => 'civicrm_print_label.description',
187 'table_name' => 'civicrm_print_label',
188 'entity' => 'PrintLabel',
189 'bao' => 'CRM_Core_DAO_PrintLabel',
190 'localizable' => 0,
191 ],
192 'label_format_name' => [
193 'name' => 'label_format_name',
194 'type' => CRM_Utils_Type::T_STRING,
195 'title' => ts('Label Format'),
196 'description' => ts('This refers to name column of civicrm_option_value row in name_badge option group'),
197 'maxlength' => 255,
198 'size' => CRM_Utils_Type::HUGE,
199 'where' => 'civicrm_print_label.label_format_name',
200 'table_name' => 'civicrm_print_label',
201 'entity' => 'PrintLabel',
202 'bao' => 'CRM_Core_DAO_PrintLabel',
203 'localizable' => 0,
204 'html' => [
205 'type' => 'Select',
206 ],
207 'pseudoconstant' => [
208 'optionGroupName' => 'name_badge',
209 'optionEditPath' => 'civicrm/admin/options/name_badge',
210 ],
211 ],
212 'label_type_id' => [
213 'name' => 'label_type_id',
214 'type' => CRM_Utils_Type::T_INT,
215 'title' => ts('Label Type'),
216 'description' => ts('Implicit FK to civicrm_option_value row in NEW label_type option group'),
217 'where' => 'civicrm_print_label.label_type_id',
218 'table_name' => 'civicrm_print_label',
219 'entity' => 'PrintLabel',
220 'bao' => 'CRM_Core_DAO_PrintLabel',
221 'localizable' => 0,
222 'html' => [
223 'type' => 'Select',
224 ],
225 'pseudoconstant' => [
226 'optionGroupName' => 'label_type',
227 'optionEditPath' => 'civicrm/admin/options/label_type',
228 ],
229 ],
230 'data' => [
231 'name' => 'data',
232 'type' => CRM_Utils_Type::T_LONGTEXT,
233 'title' => ts('Data'),
234 'description' => ts('contains json encode configurations options'),
235 'where' => 'civicrm_print_label.data',
236 'table_name' => 'civicrm_print_label',
237 'entity' => 'PrintLabel',
238 'bao' => 'CRM_Core_DAO_PrintLabel',
239 'localizable' => 0,
240 'serialize' => self::SERIALIZE_JSON,
241 ],
242 'is_default' => [
243 'name' => 'is_default',
244 'type' => CRM_Utils_Type::T_BOOLEAN,
245 'title' => ts('Label is Default?'),
246 'description' => ts('Is this default?'),
247 'where' => 'civicrm_print_label.is_default',
248 'default' => '1',
249 'table_name' => 'civicrm_print_label',
250 'entity' => 'PrintLabel',
251 'bao' => 'CRM_Core_DAO_PrintLabel',
252 'localizable' => 0,
253 ],
254 'is_active' => [
255 'name' => 'is_active',
256 'type' => CRM_Utils_Type::T_BOOLEAN,
257 'title' => ts('Label Is Active?'),
258 'description' => ts('Is this option active?'),
259 'where' => 'civicrm_print_label.is_active',
260 'default' => '1',
261 'table_name' => 'civicrm_print_label',
262 'entity' => 'PrintLabel',
263 'bao' => 'CRM_Core_DAO_PrintLabel',
264 'localizable' => 0,
265 ],
266 'is_reserved' => [
267 'name' => 'is_reserved',
268 'type' => CRM_Utils_Type::T_BOOLEAN,
269 'title' => ts('Is Label Reserved?'),
270 'description' => ts('Is this reserved label?'),
271 'where' => 'civicrm_print_label.is_reserved',
272 'default' => '1',
273 'table_name' => 'civicrm_print_label',
274 'entity' => 'PrintLabel',
275 'bao' => 'CRM_Core_DAO_PrintLabel',
276 'localizable' => 0,
277 ],
278 'created_id' => [
279 'name' => 'created_id',
280 'type' => CRM_Utils_Type::T_INT,
281 'title' => ts('Label Created By'),
282 'description' => ts('FK to civicrm_contact, who created this label layout'),
283 'where' => 'civicrm_print_label.created_id',
284 'table_name' => 'civicrm_print_label',
285 'entity' => 'PrintLabel',
286 'bao' => 'CRM_Core_DAO_PrintLabel',
287 'localizable' => 0,
288 'FKClassName' => 'CRM_Contact_DAO_Contact',
289 ],
290 ];
291 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
292 }
293 return Civi::$statics[__CLASS__]['fields'];
294 }
295
296 /**
297 * Return a mapping from field-name to the corresponding key (as used in fields()).
298 *
299 * @return array
300 * Array(string $name => string $uniqueName).
301 */
302 public static function &fieldKeys() {
303 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
304 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
305 }
306 return Civi::$statics[__CLASS__]['fieldKeys'];
307 }
308
309 /**
310 * Returns the names of this table
311 *
312 * @return string
313 */
314 public static function getTableName() {
315 return self::$_tableName;
316 }
317
318 /**
319 * Returns if this table needs to be logged
320 *
321 * @return bool
322 */
323 public function getLog() {
324 return self::$_log;
325 }
326
327 /**
328 * Returns the list of fields that can be imported
329 *
330 * @param bool $prefix
331 *
332 * @return array
333 */
334 public static function &import($prefix = FALSE) {
335 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'print_label', $prefix, []);
336 return $r;
337 }
338
339 /**
340 * Returns the list of fields that can be exported
341 *
342 * @param bool $prefix
343 *
344 * @return array
345 */
346 public static function &export($prefix = FALSE) {
347 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'print_label', $prefix, []);
348 return $r;
349 }
350
351 /**
352 * Returns the list of indices
353 *
354 * @param bool $localize
355 *
356 * @return array
357 */
358 public static function indices($localize = TRUE) {
359 $indices = [];
360 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
361 }
362
363 }