5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/CustomGroup.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:27a1b80ba9d2696e97dd1df33468caff)
13 * Database access object for the CustomGroup entity.
15 class CRM_Core_DAO_CustomGroup
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.1';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_custom_group';
27 * Field to show when displaying a record.
31 public static $_labelField = 'title';
34 * Should CiviCRM log any modifications to this table in the civicrm_log table.
38 public static $_log = TRUE;
41 * Unique Custom Group ID
48 * Variable name/programmatic handle for this group.
62 * Type of object this group extends (can add other options later e.g. contact_address, etc.).
69 * FK to civicrm_option_value.id (for option group custom_data_type.)
73 public $extends_entity_column_id;
76 * linking custom group for dynamic object
80 public $extends_entity_column_value;
83 * Visual relationship between this form and its parent.
90 * Will this group be in collapsed or expanded mode on initial display ?
94 public $collapse_display;
97 * Description and/or help text to display before fields in form.
104 * Description and/or help text to display after fields in form.
111 * Controls display order when multiple extended property groups are setup for the same class.
118 * Is this property active?
125 * Name of the table that holds the values for this group.
132 * Does this group hold multiple values?
139 * minimum number of multiple records (typically 0?)
143 public $min_multiple;
146 * maximum number of multiple records, if 0 - no max
150 public $max_multiple;
153 * Will this group be in collapsed or expanded mode on advanced search display ?
157 public $collapse_adv_display;
160 * FK to civicrm_contact, who created this custom group
167 * Date and time this custom group was created.
171 public $created_date;
174 * Is this a reserved Custom Group?
181 * Is this property public?
197 public function __construct() {
198 $this->__table
= 'civicrm_custom_group';
199 parent
::__construct();
203 * Returns localized title of this entity.
205 * @param bool $plural
206 * Whether to return the plural version of the title.
208 public static function getEntityTitle($plural = FALSE) {
209 return $plural ?
ts('Custom Field Groups') : ts('Custom Field Group');
213 * Returns foreign keys and entity references.
216 * [CRM_Core_Reference_Interface]
218 public static function getReferenceColumns() {
219 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
220 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
221 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
222 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
224 return Civi
::$statics[__CLASS__
]['links'];
228 * Returns all the column names of this table
232 public static function &fields() {
233 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
234 Civi
::$statics[__CLASS__
]['fields'] = [
237 'type' => CRM_Utils_Type
::T_INT
,
238 'title' => ts('Custom Group ID'),
239 'description' => ts('Unique Custom Group ID'),
241 'where' => 'civicrm_custom_group.id',
242 'table_name' => 'civicrm_custom_group',
243 'entity' => 'CustomGroup',
244 'bao' => 'CRM_Core_BAO_CustomGroup',
254 'type' => CRM_Utils_Type
::T_STRING
,
255 'title' => ts('Custom Group Name'),
256 'description' => ts('Variable name/programmatic handle for this group.'),
258 'size' => CRM_Utils_Type
::BIG
,
259 'where' => 'civicrm_custom_group.name',
260 'table_name' => 'civicrm_custom_group',
261 'entity' => 'CustomGroup',
262 'bao' => 'CRM_Core_BAO_CustomGroup',
268 'type' => CRM_Utils_Type
::T_STRING
,
269 'title' => ts('Custom Group Title'),
270 'description' => ts('Friendly Name.'),
273 'size' => CRM_Utils_Type
::BIG
,
274 'where' => 'civicrm_custom_group.title',
275 'table_name' => 'civicrm_custom_group',
276 'entity' => 'CustomGroup',
277 'bao' => 'CRM_Core_BAO_CustomGroup',
283 'type' => CRM_Utils_Type
::T_STRING
,
284 'title' => ts('Custom Group Extends'),
285 'description' => ts('Type of object this group extends (can add other options later e.g. contact_address, etc.).'),
287 'size' => CRM_Utils_Type
::HUGE
,
288 'where' => 'civicrm_custom_group.extends',
289 'default' => 'Contact',
290 'table_name' => 'civicrm_custom_group',
291 'entity' => 'CustomGroup',
292 'bao' => 'CRM_Core_BAO_CustomGroup',
294 'pseudoconstant' => [
295 'callback' => 'CRM_Core_SelectValues::customGroupExtends',
299 'extends_entity_column_id' => [
300 'name' => 'extends_entity_column_id',
301 'type' => CRM_Utils_Type
::T_INT
,
302 'title' => ts('Custom Group Subtype List'),
303 'description' => ts('FK to civicrm_option_value.id (for option group custom_data_type.)'),
304 'where' => 'civicrm_custom_group.extends_entity_column_id',
306 'table_name' => 'civicrm_custom_group',
307 'entity' => 'CustomGroup',
308 'bao' => 'CRM_Core_BAO_CustomGroup',
313 'pseudoconstant' => [
314 'optionGroupName' => 'custom_data_type',
315 'optionEditPath' => 'civicrm/admin/options/custom_data_type',
319 'extends_entity_column_value' => [
320 'name' => 'extends_entity_column_value',
321 'type' => CRM_Utils_Type
::T_STRING
,
322 'title' => ts('Custom Group Subtype'),
323 'description' => ts('linking custom group for dynamic object'),
325 'size' => CRM_Utils_Type
::HUGE
,
326 'where' => 'civicrm_custom_group.extends_entity_column_value',
327 'table_name' => 'civicrm_custom_group',
328 'entity' => 'CustomGroup',
329 'bao' => 'CRM_Core_BAO_CustomGroup',
331 'serialize' => self
::SERIALIZE_SEPARATOR_BOOKEND
,
336 'type' => CRM_Utils_Type
::T_STRING
,
337 'title' => ts('Custom Group Style'),
338 'description' => ts('Visual relationship between this form and its parent.'),
340 'size' => CRM_Utils_Type
::TWELVE
,
341 'where' => 'civicrm_custom_group.style',
342 'table_name' => 'civicrm_custom_group',
343 'entity' => 'CustomGroup',
344 'bao' => 'CRM_Core_BAO_CustomGroup',
349 'pseudoconstant' => [
350 'callback' => 'CRM_Core_SelectValues::customGroupStyle',
354 'collapse_display' => [
355 'name' => 'collapse_display',
356 'type' => CRM_Utils_Type
::T_BOOLEAN
,
357 'title' => ts('Collapse Custom Group?'),
358 'description' => ts('Will this group be in collapsed or expanded mode on initial display ?'),
359 'where' => 'civicrm_custom_group.collapse_display',
361 'table_name' => 'civicrm_custom_group',
362 'entity' => 'CustomGroup',
363 'bao' => 'CRM_Core_BAO_CustomGroup',
368 'name' => 'help_pre',
369 'type' => CRM_Utils_Type
::T_TEXT
,
370 'title' => ts('Custom Group Pre Text'),
371 'description' => ts('Description and/or help text to display before fields in form.'),
374 'where' => 'civicrm_custom_group.help_pre',
375 'table_name' => 'civicrm_custom_group',
376 'entity' => 'CustomGroup',
377 'bao' => 'CRM_Core_BAO_CustomGroup',
380 'type' => 'TextArea',
385 'name' => 'help_post',
386 'type' => CRM_Utils_Type
::T_TEXT
,
387 'title' => ts('Custom Group Post Text'),
388 'description' => ts('Description and/or help text to display after fields in form.'),
391 'where' => 'civicrm_custom_group.help_post',
392 'table_name' => 'civicrm_custom_group',
393 'entity' => 'CustomGroup',
394 'bao' => 'CRM_Core_BAO_CustomGroup',
397 'type' => 'TextArea',
403 'type' => CRM_Utils_Type
::T_INT
,
404 'title' => ts('Order'),
405 'description' => ts('Controls display order when multiple extended property groups are setup for the same class.'),
407 'where' => 'civicrm_custom_group.weight',
409 'table_name' => 'civicrm_custom_group',
410 'entity' => 'CustomGroup',
411 'bao' => 'CRM_Core_BAO_CustomGroup',
416 'name' => 'is_active',
417 'type' => CRM_Utils_Type
::T_BOOLEAN
,
418 'title' => ts('Custom Group Is Active?'),
419 'description' => ts('Is this property active?'),
420 'where' => 'civicrm_custom_group.is_active',
422 'table_name' => 'civicrm_custom_group',
423 'entity' => 'CustomGroup',
424 'bao' => 'CRM_Core_BAO_CustomGroup',
429 'name' => 'table_name',
430 'type' => CRM_Utils_Type
::T_STRING
,
431 'title' => ts('Table Name'),
432 'description' => ts('Name of the table that holds the values for this group.'),
434 'size' => CRM_Utils_Type
::HUGE
,
435 'where' => 'civicrm_custom_group.table_name',
436 'table_name' => 'civicrm_custom_group',
437 'entity' => 'CustomGroup',
438 'bao' => 'CRM_Core_BAO_CustomGroup',
441 'label' => ts("Table Name"),
447 'name' => 'is_multiple',
448 'type' => CRM_Utils_Type
::T_BOOLEAN
,
449 'title' => ts('Supports Multiple Records'),
450 'description' => ts('Does this group hold multiple values?'),
451 'where' => 'civicrm_custom_group.is_multiple',
453 'table_name' => 'civicrm_custom_group',
454 'entity' => 'CustomGroup',
455 'bao' => 'CRM_Core_BAO_CustomGroup',
460 'name' => 'min_multiple',
461 'type' => CRM_Utils_Type
::T_INT
,
462 'title' => ts('Minimum Multiple Records'),
463 'description' => ts('minimum number of multiple records (typically 0?)'),
464 'where' => 'civicrm_custom_group.min_multiple',
465 'table_name' => 'civicrm_custom_group',
466 'entity' => 'CustomGroup',
467 'bao' => 'CRM_Core_BAO_CustomGroup',
472 'name' => 'max_multiple',
473 'type' => CRM_Utils_Type
::T_INT
,
474 'title' => ts('Maximum Multiple Records'),
475 'description' => ts('maximum number of multiple records, if 0 - no max'),
476 'where' => 'civicrm_custom_group.max_multiple',
477 'table_name' => 'civicrm_custom_group',
478 'entity' => 'CustomGroup',
479 'bao' => 'CRM_Core_BAO_CustomGroup',
483 'collapse_adv_display' => [
484 'name' => 'collapse_adv_display',
485 'type' => CRM_Utils_Type
::T_BOOLEAN
,
486 'title' => ts('Collapse Group Display'),
487 'description' => ts('Will this group be in collapsed or expanded mode on advanced search display ?'),
488 'where' => 'civicrm_custom_group.collapse_adv_display',
490 'table_name' => 'civicrm_custom_group',
491 'entity' => 'CustomGroup',
492 'bao' => 'CRM_Core_BAO_CustomGroup',
497 'name' => 'created_id',
498 'type' => CRM_Utils_Type
::T_INT
,
499 'title' => ts('Created By Contact ID'),
500 'description' => ts('FK to civicrm_contact, who created this custom group'),
501 'where' => 'civicrm_custom_group.created_id',
502 'table_name' => 'civicrm_custom_group',
503 'entity' => 'CustomGroup',
504 'bao' => 'CRM_Core_BAO_CustomGroup',
506 'FKClassName' => 'CRM_Contact_DAO_Contact',
508 'label' => ts("Created By"),
513 'name' => 'created_date',
514 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
515 'title' => ts('Custom Group Created Date'),
516 'description' => ts('Date and time this custom group was created.'),
517 'where' => 'civicrm_custom_group.created_date',
518 'table_name' => 'civicrm_custom_group',
519 'entity' => 'CustomGroup',
520 'bao' => 'CRM_Core_BAO_CustomGroup',
525 'name' => 'is_reserved',
526 'type' => CRM_Utils_Type
::T_BOOLEAN
,
527 'title' => ts('Reserved Group?'),
528 'description' => ts('Is this a reserved Custom Group?'),
529 'where' => 'civicrm_custom_group.is_reserved',
531 'table_name' => 'civicrm_custom_group',
532 'entity' => 'CustomGroup',
533 'bao' => 'CRM_Core_BAO_CustomGroup',
538 'name' => 'is_public',
539 'type' => CRM_Utils_Type
::T_BOOLEAN
,
540 'title' => ts('Custom Group Is Public?'),
541 'description' => ts('Is this property public?'),
542 'where' => 'civicrm_custom_group.is_public',
544 'table_name' => 'civicrm_custom_group',
545 'entity' => 'CustomGroup',
546 'bao' => 'CRM_Core_BAO_CustomGroup',
552 'type' => CRM_Utils_Type
::T_STRING
,
553 'title' => ts('Icon'),
554 'description' => ts('crm-i icon class'),
556 'size' => CRM_Utils_Type
::HUGE
,
557 'where' => 'civicrm_custom_group.icon',
559 'table_name' => 'civicrm_custom_group',
560 'entity' => 'CustomGroup',
561 'bao' => 'CRM_Core_BAO_CustomGroup',
566 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
568 return Civi
::$statics[__CLASS__
]['fields'];
572 * Return a mapping from field-name to the corresponding key (as used in fields()).
575 * Array(string $name => string $uniqueName).
577 public static function &fieldKeys() {
578 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
579 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
581 return Civi
::$statics[__CLASS__
]['fieldKeys'];
585 * Returns the names of this table
589 public static function getTableName() {
590 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
594 * Returns if this table needs to be logged
598 public function getLog() {
603 * Returns the list of fields that can be imported
605 * @param bool $prefix
609 public static function &import($prefix = FALSE) {
610 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'custom_group', $prefix, []);
615 * Returns the list of fields that can be exported
617 * @param bool $prefix
621 public static function &export($prefix = FALSE) {
622 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'custom_group', $prefix, []);
627 * Returns the list of indices
629 * @param bool $localize
633 public static function indices($localize = TRUE) {
635 'UI_title_extends' => [
636 'name' => 'UI_title_extends',
641 'localizable' => TRUE,
643 'sig' => 'civicrm_custom_group::1::title::extends',
645 'UI_name_extends' => [
646 'name' => 'UI_name_extends',
651 'localizable' => FALSE,
653 'sig' => 'civicrm_custom_group::1::name::extends',
656 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;