Merge pull request #20884 from MegaphoneJon/financial-89
[civicrm-core.git] / CRM / Core / DAO / CustomGroup.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/CustomGroup.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
8ad19d07 9 * (GenCodeChecksum:57ebfb396e58116709f9d883a46edfa7)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the CustomGroup entity.
f41f0342 14 */
e501603b 15class CRM_Core_DAO_CustomGroup extends CRM_Core_DAO {
929a1c14
CW
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '1.1';
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_custom_group';
c3fc2621 25
8ab43c93
CW
26 /**
27 * Field to show when displaying a record.
28 *
29 * @var string
30 */
31 public static $_labelField = 'title';
32
e501603b 33 /**
f41f0342 34 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 35 *
c3fc2621 36 * @var bool
e501603b 37 */
fa45b5b9 38 public static $_log = TRUE;
c3fc2621 39
8ad19d07
CW
40 /**
41 * Paths for accessing this entity in the UI.
42 *
43 * @var string[]
44 */
45 protected static $_paths = [
46 'add' => 'civicrm/admin/custom/group?action=add&reset=1',
47 'update' => 'civicrm/admin/custom/group?action=update&reset=1&id=[id]',
48 'preview' => 'civicrm/admin/custom/group?action=preview&reset=1&id=[id]',
49 'delete' => 'civicrm/admin/custom/group?action=delete&reset=1&id=[id]',
50 ];
51
e501603b
TO
52 /**
53 * Unique Custom Group ID
54 *
e6ca0a57 55 * @var int
e501603b
TO
56 */
57 public $id;
c3fc2621 58
e501603b
TO
59 /**
60 * Variable name/programmatic handle for this group.
61 *
62 * @var string
63 */
64 public $name;
c3fc2621 65
e501603b
TO
66 /**
67 * Friendly Name.
68 *
69 * @var string
70 */
71 public $title;
c3fc2621 72
e501603b
TO
73 /**
74 * Type of object this group extends (can add other options later e.g. contact_address, etc.).
75 *
76 * @var string
77 */
78 public $extends;
c3fc2621 79
e501603b
TO
80 /**
81 * FK to civicrm_option_value.id (for option group custom_data_type.)
82 *
e6ca0a57 83 * @var int
e501603b
TO
84 */
85 public $extends_entity_column_id;
c3fc2621 86
e501603b
TO
87 /**
88 * linking custom group for dynamic object
89 *
90 * @var string
91 */
92 public $extends_entity_column_value;
c3fc2621 93
e501603b
TO
94 /**
95 * Visual relationship between this form and its parent.
96 *
97 * @var string
98 */
99 public $style;
c3fc2621 100
e501603b
TO
101 /**
102 * Will this group be in collapsed or expanded mode on initial display ?
103 *
9752268e 104 * @var bool
e501603b
TO
105 */
106 public $collapse_display;
c3fc2621 107
e501603b
TO
108 /**
109 * Description and/or help text to display before fields in form.
110 *
111 * @var text
112 */
113 public $help_pre;
c3fc2621 114
e501603b
TO
115 /**
116 * Description and/or help text to display after fields in form.
117 *
118 * @var text
119 */
120 public $help_post;
c3fc2621 121
e501603b
TO
122 /**
123 * Controls display order when multiple extended property groups are setup for the same class.
124 *
125 * @var int
126 */
127 public $weight;
c3fc2621 128
e501603b
TO
129 /**
130 * Is this property active?
131 *
e6ca0a57 132 * @var bool
e501603b
TO
133 */
134 public $is_active;
c3fc2621 135
e501603b
TO
136 /**
137 * Name of the table that holds the values for this group.
138 *
139 * @var string
140 */
141 public $table_name;
c3fc2621 142
e501603b
TO
143 /**
144 * Does this group hold multiple values?
145 *
e6ca0a57 146 * @var bool
e501603b
TO
147 */
148 public $is_multiple;
c3fc2621 149
e501603b
TO
150 /**
151 * minimum number of multiple records (typically 0?)
152 *
e6ca0a57 153 * @var int
e501603b
TO
154 */
155 public $min_multiple;
c3fc2621 156
e501603b
TO
157 /**
158 * maximum number of multiple records, if 0 - no max
159 *
e6ca0a57 160 * @var int
e501603b
TO
161 */
162 public $max_multiple;
c3fc2621 163
e501603b
TO
164 /**
165 * Will this group be in collapsed or expanded mode on advanced search display ?
166 *
9752268e 167 * @var bool
e501603b
TO
168 */
169 public $collapse_adv_display;
c3fc2621 170
e501603b
TO
171 /**
172 * FK to civicrm_contact, who created this custom group
173 *
e6ca0a57 174 * @var int
e501603b
TO
175 */
176 public $created_id;
c3fc2621 177
e501603b
TO
178 /**
179 * Date and time this custom group was created.
180 *
181 * @var datetime
182 */
183 public $created_date;
c3fc2621 184
e501603b
TO
185 /**
186 * Is this a reserved Custom Group?
187 *
e6ca0a57 188 * @var bool
e501603b
TO
189 */
190 public $is_reserved;
c3fc2621 191
460931ca
JP
192 /**
193 * Is this property public?
194 *
e6ca0a57 195 * @var bool
460931ca
JP
196 */
197 public $is_public;
c3fc2621 198
2af06525
CW
199 /**
200 * crm-i icon class
201 *
202 * @var string
203 */
204 public $icon;
205
e501603b 206 /**
f41f0342 207 * Class constructor.
e501603b 208 */
c3fc2621 209 public function __construct() {
e501603b
TO
210 $this->__table = 'civicrm_custom_group';
211 parent::__construct();
212 }
c3fc2621 213
449c4e6b
CW
214 /**
215 * Returns localized title of this entity.
7b66c3b5
AH
216 *
217 * @param bool $plural
218 * Whether to return the plural version of the title.
449c4e6b 219 */
7b66c3b5 220 public static function getEntityTitle($plural = FALSE) {
812fe84d 221 return $plural ? ts('Custom Field Groups') : ts('Custom Field Group');
449c4e6b
CW
222 }
223
e501603b 224 /**
f41f0342 225 * Returns foreign keys and entity references.
e501603b
TO
226 *
227 * @return array
228 * [CRM_Core_Reference_Interface]
229 */
c3fc2621 230 public static function getReferenceColumns() {
346aaaba 231 if (!isset(Civi::$statics[__CLASS__]['links'])) {
fa45b5b9 232 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621 233 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'created_id', 'civicrm_contact', 'id');
346aaaba 234 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 235 }
346aaaba 236 return Civi::$statics[__CLASS__]['links'];
e501603b 237 }
c3fc2621 238
e501603b
TO
239 /**
240 * Returns all the column names of this table
241 *
242 * @return array
243 */
c3fc2621 244 public static function &fields() {
346aaaba 245 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
246 Civi::$statics[__CLASS__]['fields'] = [
247 'id' => [
e501603b
TO
248 'name' => 'id',
249 'type' => CRM_Utils_Type::T_INT,
c3fc2621 250 'title' => ts('Custom Group ID'),
215b423e 251 'description' => ts('Unique Custom Group ID'),
c3fc2621 252 'required' => TRUE,
a36434b9 253 'where' => 'civicrm_custom_group.id',
522a26c9 254 'table_name' => 'civicrm_custom_group',
255 'entity' => 'CustomGroup',
256 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 257 'localizable' => 0,
2cbbebe8
A
258 'html' => [
259 'type' => 'Number',
260 ],
1fe423d6 261 'readonly' => TRUE,
a9d0587b 262 'add' => '1.1',
c3fc2621
CW
263 ],
264 'name' => [
e501603b
TO
265 'name' => 'name',
266 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 267 'title' => ts('Custom Group Name'),
215b423e 268 'description' => ts('Variable name/programmatic handle for this group.'),
e501603b
TO
269 'maxlength' => 64,
270 'size' => CRM_Utils_Type::BIG,
a36434b9 271 'where' => 'civicrm_custom_group.name',
522a26c9 272 'table_name' => 'civicrm_custom_group',
273 'entity' => 'CustomGroup',
274 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 275 'localizable' => 0,
a9d0587b 276 'add' => '1.1',
c3fc2621
CW
277 ],
278 'title' => [
e501603b
TO
279 'name' => 'title',
280 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 281 'title' => ts('Custom Group Title'),
215b423e 282 'description' => ts('Friendly Name.'),
c3fc2621 283 'required' => TRUE,
e501603b
TO
284 'maxlength' => 64,
285 'size' => CRM_Utils_Type::BIG,
a36434b9 286 'where' => 'civicrm_custom_group.title',
522a26c9 287 'table_name' => 'civicrm_custom_group',
288 'entity' => 'CustomGroup',
289 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 290 'localizable' => 1,
a9d0587b 291 'add' => '1.1',
c3fc2621
CW
292 ],
293 'extends' => [
e501603b
TO
294 'name' => 'extends',
295 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 296 'title' => ts('Custom Group Extends'),
215b423e 297 'description' => ts('Type of object this group extends (can add other options later e.g. contact_address, etc.).'),
e501603b
TO
298 'maxlength' => 255,
299 'size' => CRM_Utils_Type::HUGE,
a36434b9 300 'where' => 'civicrm_custom_group.extends',
e501603b 301 'default' => 'Contact',
522a26c9 302 'table_name' => 'civicrm_custom_group',
303 'entity' => 'CustomGroup',
304 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 305 'localizable' => 0,
c9ac084f
CW
306 'pseudoconstant' => [
307 'callback' => 'CRM_Core_SelectValues::customGroupExtends',
308 ],
a9d0587b 309 'add' => '1.1',
c3fc2621
CW
310 ],
311 'extends_entity_column_id' => [
e501603b
TO
312 'name' => 'extends_entity_column_id',
313 'type' => CRM_Utils_Type::T_INT,
c3fc2621 314 'title' => ts('Custom Group Subtype List'),
215b423e 315 'description' => ts('FK to civicrm_option_value.id (for option group custom_data_type.)'),
a36434b9 316 'where' => 'civicrm_custom_group.extends_entity_column_id',
5fb0de1f 317 'default' => NULL,
522a26c9 318 'table_name' => 'civicrm_custom_group',
319 'entity' => 'CustomGroup',
320 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 321 'localizable' => 0,
233319bf 322 'html' => [
323 'type' => 'Select',
324 ],
325 'pseudoconstant' => [
326 'optionGroupName' => 'custom_data_type',
327 'optionEditPath' => 'civicrm/admin/options/custom_data_type',
e6ca0a57 328 ],
a9d0587b 329 'add' => '2.2',
c3fc2621
CW
330 ],
331 'extends_entity_column_value' => [
e501603b
TO
332 'name' => 'extends_entity_column_value',
333 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 334 'title' => ts('Custom Group Subtype'),
215b423e 335 'description' => ts('linking custom group for dynamic object'),
e501603b
TO
336 'maxlength' => 255,
337 'size' => CRM_Utils_Type::HUGE,
a36434b9 338 'where' => 'civicrm_custom_group.extends_entity_column_value',
522a26c9 339 'table_name' => 'civicrm_custom_group',
340 'entity' => 'CustomGroup',
341 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 342 'localizable' => 0,
2a5c9b4d 343 'serialize' => self::SERIALIZE_SEPARATOR_BOOKEND,
a9d0587b 344 'add' => '1.6',
c3fc2621
CW
345 ],
346 'style' => [
e501603b
TO
347 'name' => 'style',
348 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 349 'title' => ts('Custom Group Style'),
215b423e 350 'description' => ts('Visual relationship between this form and its parent.'),
e501603b
TO
351 'maxlength' => 15,
352 'size' => CRM_Utils_Type::TWELVE,
a36434b9 353 'where' => 'civicrm_custom_group.style',
522a26c9 354 'table_name' => 'civicrm_custom_group',
355 'entity' => 'CustomGroup',
356 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 357 'localizable' => 0,
c3fc2621 358 'html' => [
e501603b 359 'type' => 'Select',
c3fc2621
CW
360 ],
361 'pseudoconstant' => [
e501603b 362 'callback' => 'CRM_Core_SelectValues::customGroupStyle',
e6ca0a57 363 ],
a9d0587b 364 'add' => '1.1',
c3fc2621
CW
365 ],
366 'collapse_display' => [
e501603b 367 'name' => 'collapse_display',
9752268e 368 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 369 'title' => ts('Collapse Custom Group?'),
215b423e 370 'description' => ts('Will this group be in collapsed or expanded mode on initial display ?'),
a36434b9 371 'where' => 'civicrm_custom_group.collapse_display',
45a83e42 372 'default' => '0',
522a26c9 373 'table_name' => 'civicrm_custom_group',
374 'entity' => 'CustomGroup',
375 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 376 'localizable' => 0,
a9d0587b 377 'add' => '1.1',
c3fc2621
CW
378 ],
379 'help_pre' => [
e501603b
TO
380 'name' => 'help_pre',
381 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 382 'title' => ts('Custom Group Pre Text'),
215b423e 383 'description' => ts('Description and/or help text to display before fields in form.'),
e501603b
TO
384 'rows' => 4,
385 'cols' => 80,
a36434b9 386 'where' => 'civicrm_custom_group.help_pre',
522a26c9 387 'table_name' => 'civicrm_custom_group',
388 'entity' => 'CustomGroup',
389 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 390 'localizable' => 1,
c3fc2621 391 'html' => [
e501603b 392 'type' => 'TextArea',
c3fc2621 393 ],
a9d0587b 394 'add' => '1.1',
c3fc2621
CW
395 ],
396 'help_post' => [
e501603b
TO
397 'name' => 'help_post',
398 'type' => CRM_Utils_Type::T_TEXT,
c3fc2621 399 'title' => ts('Custom Group Post Text'),
215b423e 400 'description' => ts('Description and/or help text to display after fields in form.'),
e501603b
TO
401 'rows' => 4,
402 'cols' => 80,
a36434b9 403 'where' => 'civicrm_custom_group.help_post',
522a26c9 404 'table_name' => 'civicrm_custom_group',
405 'entity' => 'CustomGroup',
406 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 407 'localizable' => 1,
c3fc2621 408 'html' => [
e501603b 409 'type' => 'TextArea',
c3fc2621 410 ],
a9d0587b 411 'add' => '1.1',
c3fc2621
CW
412 ],
413 'weight' => [
e501603b
TO
414 'name' => 'weight',
415 'type' => CRM_Utils_Type::T_INT,
c3fc2621 416 'title' => ts('Order'),
215b423e 417 'description' => ts('Controls display order when multiple extended property groups are setup for the same class.'),
c3fc2621 418 'required' => TRUE,
a36434b9 419 'where' => 'civicrm_custom_group.weight',
e501603b 420 'default' => '1',
522a26c9 421 'table_name' => 'civicrm_custom_group',
422 'entity' => 'CustomGroup',
423 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 424 'localizable' => 0,
a9d0587b 425 'add' => '1.1',
c3fc2621
CW
426 ],
427 'is_active' => [
e501603b
TO
428 'name' => 'is_active',
429 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 430 'title' => ts('Custom Group Is Active?'),
215b423e 431 'description' => ts('Is this property active?'),
a36434b9 432 'where' => 'civicrm_custom_group.is_active',
110f4343 433 'default' => '1',
522a26c9 434 'table_name' => 'civicrm_custom_group',
435 'entity' => 'CustomGroup',
436 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 437 'localizable' => 0,
a9d0587b 438 'add' => '1.1',
c3fc2621
CW
439 ],
440 'table_name' => [
e501603b
TO
441 'name' => 'table_name',
442 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 443 'title' => ts('Table Name'),
215b423e 444 'description' => ts('Name of the table that holds the values for this group.'),
e501603b
TO
445 'maxlength' => 255,
446 'size' => CRM_Utils_Type::HUGE,
a36434b9 447 'where' => 'civicrm_custom_group.table_name',
522a26c9 448 'table_name' => 'civicrm_custom_group',
449 'entity' => 'CustomGroup',
450 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 451 'localizable' => 0,
c23563e3
SL
452 'html' => [
453 'label' => ts("Table Name"),
454 ],
88620a59 455 'readonly' => TRUE,
a9d0587b 456 'add' => '2.0',
c3fc2621
CW
457 ],
458 'is_multiple' => [
e501603b
TO
459 'name' => 'is_multiple',
460 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 461 'title' => ts('Supports Multiple Records'),
215b423e 462 'description' => ts('Does this group hold multiple values?'),
a36434b9 463 'where' => 'civicrm_custom_group.is_multiple',
45a83e42 464 'default' => '0',
522a26c9 465 'table_name' => 'civicrm_custom_group',
466 'entity' => 'CustomGroup',
467 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 468 'localizable' => 0,
a9d0587b 469 'add' => '2.0',
c3fc2621
CW
470 ],
471 'min_multiple' => [
e501603b
TO
472 'name' => 'min_multiple',
473 'type' => CRM_Utils_Type::T_INT,
c3fc2621 474 'title' => ts('Minimum Multiple Records'),
215b423e 475 'description' => ts('minimum number of multiple records (typically 0?)'),
a36434b9 476 'where' => 'civicrm_custom_group.min_multiple',
522a26c9 477 'table_name' => 'civicrm_custom_group',
478 'entity' => 'CustomGroup',
479 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 480 'localizable' => 0,
a9d0587b 481 'add' => '2.2',
c3fc2621
CW
482 ],
483 'max_multiple' => [
e501603b
TO
484 'name' => 'max_multiple',
485 'type' => CRM_Utils_Type::T_INT,
c3fc2621 486 'title' => ts('Maximum Multiple Records'),
215b423e 487 'description' => ts('maximum number of multiple records, if 0 - no max'),
a36434b9 488 'where' => 'civicrm_custom_group.max_multiple',
522a26c9 489 'table_name' => 'civicrm_custom_group',
490 'entity' => 'CustomGroup',
491 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 492 'localizable' => 0,
a9d0587b 493 'add' => '2.2',
c3fc2621
CW
494 ],
495 'collapse_adv_display' => [
e501603b 496 'name' => 'collapse_adv_display',
9752268e 497 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 498 'title' => ts('Collapse Group Display'),
215b423e 499 'description' => ts('Will this group be in collapsed or expanded mode on advanced search display ?'),
a36434b9 500 'where' => 'civicrm_custom_group.collapse_adv_display',
45a83e42 501 'default' => '0',
522a26c9 502 'table_name' => 'civicrm_custom_group',
503 'entity' => 'CustomGroup',
504 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 505 'localizable' => 0,
a9d0587b 506 'add' => '3.0',
c3fc2621
CW
507 ],
508 'created_id' => [
e501603b
TO
509 'name' => 'created_id',
510 'type' => CRM_Utils_Type::T_INT,
2cbbebe8 511 'title' => ts('Created By Contact ID'),
215b423e 512 'description' => ts('FK to civicrm_contact, who created this custom group'),
a36434b9 513 'where' => 'civicrm_custom_group.created_id',
522a26c9 514 'table_name' => 'civicrm_custom_group',
515 'entity' => 'CustomGroup',
516 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 517 'localizable' => 0,
e501603b 518 'FKClassName' => 'CRM_Contact_DAO_Contact',
2cbbebe8
A
519 'html' => [
520 'label' => ts("Created By"),
521 ],
a9d0587b 522 'add' => '3.0',
c3fc2621
CW
523 ],
524 'created_date' => [
e501603b
TO
525 'name' => 'created_date',
526 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
c3fc2621 527 'title' => ts('Custom Group Created Date'),
215b423e 528 'description' => ts('Date and time this custom group was created.'),
a36434b9 529 'where' => 'civicrm_custom_group.created_date',
522a26c9 530 'table_name' => 'civicrm_custom_group',
531 'entity' => 'CustomGroup',
532 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 533 'localizable' => 0,
a9d0587b 534 'add' => '3.0',
c3fc2621
CW
535 ],
536 'is_reserved' => [
e501603b
TO
537 'name' => 'is_reserved',
538 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 539 'title' => ts('Reserved Group?'),
215b423e 540 'description' => ts('Is this a reserved Custom Group?'),
a36434b9 541 'where' => 'civicrm_custom_group.is_reserved',
45a83e42 542 'default' => '0',
522a26c9 543 'table_name' => 'civicrm_custom_group',
544 'entity' => 'CustomGroup',
545 'bao' => 'CRM_Core_BAO_CustomGroup',
6a7e5e5d 546 'localizable' => 0,
a9d0587b 547 'add' => '4.4',
c3fc2621
CW
548 ],
549 'is_public' => [
460931ca
JP
550 'name' => 'is_public',
551 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 552 'title' => ts('Custom Group Is Public?'),
215b423e 553 'description' => ts('Is this property public?'),
a36434b9 554 'where' => 'civicrm_custom_group.is_public',
460931ca
JP
555 'default' => '1',
556 'table_name' => 'civicrm_custom_group',
557 'entity' => 'CustomGroup',
558 'bao' => 'CRM_Core_BAO_CustomGroup',
559 'localizable' => 0,
a9d0587b 560 'add' => '4.7',
c3fc2621 561 ],
2af06525
CW
562 'icon' => [
563 'name' => 'icon',
564 'type' => CRM_Utils_Type::T_STRING,
565 'title' => ts('Icon'),
566 'description' => ts('crm-i icon class'),
567 'maxlength' => 255,
568 'size' => CRM_Utils_Type::HUGE,
569 'where' => 'civicrm_custom_group.icon',
5fb0de1f 570 'default' => NULL,
2af06525
CW
571 'table_name' => 'civicrm_custom_group',
572 'entity' => 'CustomGroup',
573 'bao' => 'CRM_Core_BAO_CustomGroup',
574 'localizable' => 0,
a9d0587b 575 'add' => '5.28',
2af06525 576 ],
c3fc2621 577 ];
346aaaba 578 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 579 }
346aaaba 580 return Civi::$statics[__CLASS__]['fields'];
e501603b 581 }
c3fc2621 582
e501603b 583 /**
bd8e0b14 584 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
585 *
586 * @return array
bd8e0b14 587 * Array(string $name => string $uniqueName).
e501603b 588 */
c3fc2621 589 public static function &fieldKeys() {
bd8e0b14
TO
590 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
591 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 592 }
bd8e0b14 593 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 594 }
c3fc2621 595
e501603b
TO
596 /**
597 * Returns the names of this table
598 *
599 * @return string
600 */
c3fc2621 601 public static function getTableName() {
e501603b
TO
602 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
603 }
c3fc2621 604
e501603b
TO
605 /**
606 * Returns if this table needs to be logged
607 *
c3fc2621 608 * @return bool
e501603b 609 */
c3fc2621 610 public function getLog() {
e501603b
TO
611 return self::$_log;
612 }
c3fc2621 613
e501603b
TO
614 /**
615 * Returns the list of fields that can be imported
616 *
617 * @param bool $prefix
618 *
619 * @return array
620 */
c3fc2621
CW
621 public static function &import($prefix = FALSE) {
622 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'custom_group', $prefix, []);
60808919 623 return $r;
e501603b 624 }
c3fc2621 625
e501603b
TO
626 /**
627 * Returns the list of fields that can be exported
628 *
629 * @param bool $prefix
630 *
631 * @return array
632 */
c3fc2621
CW
633 public static function &export($prefix = FALSE) {
634 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'custom_group', $prefix, []);
60808919 635 return $r;
e501603b 636 }
c3fc2621 637
e7a6b91a
AS
638 /**
639 * Returns the list of indices
c3fc2621
CW
640 *
641 * @param bool $localize
642 *
643 * @return array
e7a6b91a
AS
644 */
645 public static function indices($localize = TRUE) {
c3fc2621
CW
646 $indices = [
647 'UI_title_extends' => [
e7a6b91a 648 'name' => 'UI_title_extends',
c3fc2621 649 'field' => [
e7a6b91a
AS
650 0 => 'title',
651 1 => 'extends',
c3fc2621
CW
652 ],
653 'localizable' => TRUE,
654 'unique' => TRUE,
e7a6b91a 655 'sig' => 'civicrm_custom_group::1::title::extends',
c3fc2621
CW
656 ],
657 'UI_name_extends' => [
e7a6b91a 658 'name' => 'UI_name_extends',
c3fc2621 659 'field' => [
e7a6b91a
AS
660 0 => 'name',
661 1 => 'extends',
c3fc2621
CW
662 ],
663 'localizable' => FALSE,
664 'unique' => TRUE,
e7a6b91a 665 'sig' => 'civicrm_custom_group::1::name::extends',
c3fc2621
CW
666 ],
667 ];
e7a6b91a
AS
668 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
669 }
c3fc2621 670
e501603b 671}