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:fbf405c2b8b04de06a84977970ae8b02)
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 Groups') : ts('Custom 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',
296 'extends_entity_column_id' => [
297 'name' => 'extends_entity_column_id',
298 'type' => CRM_Utils_Type
::T_INT
,
299 'title' => ts('Custom Group Subtype List'),
300 'description' => ts('FK to civicrm_option_value.id (for option group custom_data_type.)'),
301 'where' => 'civicrm_custom_group.extends_entity_column_id',
303 'table_name' => 'civicrm_custom_group',
304 'entity' => 'CustomGroup',
305 'bao' => 'CRM_Core_BAO_CustomGroup',
310 'pseudoconstant' => [
311 'optionGroupName' => 'custom_data_type',
312 'optionEditPath' => 'civicrm/admin/options/custom_data_type',
316 'extends_entity_column_value' => [
317 'name' => 'extends_entity_column_value',
318 'type' => CRM_Utils_Type
::T_STRING
,
319 'title' => ts('Custom Group Subtype'),
320 'description' => ts('linking custom group for dynamic object'),
322 'size' => CRM_Utils_Type
::HUGE
,
323 'where' => 'civicrm_custom_group.extends_entity_column_value',
324 'table_name' => 'civicrm_custom_group',
325 'entity' => 'CustomGroup',
326 'bao' => 'CRM_Core_BAO_CustomGroup',
328 'serialize' => self
::SERIALIZE_SEPARATOR_BOOKEND
,
333 'type' => CRM_Utils_Type
::T_STRING
,
334 'title' => ts('Custom Group Style'),
335 'description' => ts('Visual relationship between this form and its parent.'),
337 'size' => CRM_Utils_Type
::TWELVE
,
338 'where' => 'civicrm_custom_group.style',
339 'table_name' => 'civicrm_custom_group',
340 'entity' => 'CustomGroup',
341 'bao' => 'CRM_Core_BAO_CustomGroup',
346 'pseudoconstant' => [
347 'callback' => 'CRM_Core_SelectValues::customGroupStyle',
351 'collapse_display' => [
352 'name' => 'collapse_display',
353 'type' => CRM_Utils_Type
::T_BOOLEAN
,
354 'title' => ts('Collapse Custom Group?'),
355 'description' => ts('Will this group be in collapsed or expanded mode on initial display ?'),
356 'where' => 'civicrm_custom_group.collapse_display',
358 'table_name' => 'civicrm_custom_group',
359 'entity' => 'CustomGroup',
360 'bao' => 'CRM_Core_BAO_CustomGroup',
365 'name' => 'help_pre',
366 'type' => CRM_Utils_Type
::T_TEXT
,
367 'title' => ts('Custom Group Pre Text'),
368 'description' => ts('Description and/or help text to display before fields in form.'),
371 'where' => 'civicrm_custom_group.help_pre',
372 'table_name' => 'civicrm_custom_group',
373 'entity' => 'CustomGroup',
374 'bao' => 'CRM_Core_BAO_CustomGroup',
377 'type' => 'TextArea',
382 'name' => 'help_post',
383 'type' => CRM_Utils_Type
::T_TEXT
,
384 'title' => ts('Custom Group Post Text'),
385 'description' => ts('Description and/or help text to display after fields in form.'),
388 'where' => 'civicrm_custom_group.help_post',
389 'table_name' => 'civicrm_custom_group',
390 'entity' => 'CustomGroup',
391 'bao' => 'CRM_Core_BAO_CustomGroup',
394 'type' => 'TextArea',
400 'type' => CRM_Utils_Type
::T_INT
,
401 'title' => ts('Order'),
402 'description' => ts('Controls display order when multiple extended property groups are setup for the same class.'),
404 'where' => 'civicrm_custom_group.weight',
406 'table_name' => 'civicrm_custom_group',
407 'entity' => 'CustomGroup',
408 'bao' => 'CRM_Core_BAO_CustomGroup',
413 'name' => 'is_active',
414 'type' => CRM_Utils_Type
::T_BOOLEAN
,
415 'title' => ts('Custom Group Is Active?'),
416 'description' => ts('Is this property active?'),
417 'where' => 'civicrm_custom_group.is_active',
419 'table_name' => 'civicrm_custom_group',
420 'entity' => 'CustomGroup',
421 'bao' => 'CRM_Core_BAO_CustomGroup',
426 'name' => 'table_name',
427 'type' => CRM_Utils_Type
::T_STRING
,
428 'title' => ts('Table Name'),
429 'description' => ts('Name of the table that holds the values for this group.'),
431 'size' => CRM_Utils_Type
::HUGE
,
432 'where' => 'civicrm_custom_group.table_name',
433 'table_name' => 'civicrm_custom_group',
434 'entity' => 'CustomGroup',
435 'bao' => 'CRM_Core_BAO_CustomGroup',
438 'label' => ts("Table Name"),
444 'name' => 'is_multiple',
445 'type' => CRM_Utils_Type
::T_BOOLEAN
,
446 'title' => ts('Supports Multiple Records'),
447 'description' => ts('Does this group hold multiple values?'),
448 'where' => 'civicrm_custom_group.is_multiple',
450 'table_name' => 'civicrm_custom_group',
451 'entity' => 'CustomGroup',
452 'bao' => 'CRM_Core_BAO_CustomGroup',
457 'name' => 'min_multiple',
458 'type' => CRM_Utils_Type
::T_INT
,
459 'title' => ts('Minimum Multiple Records'),
460 'description' => ts('minimum number of multiple records (typically 0?)'),
461 'where' => 'civicrm_custom_group.min_multiple',
462 'table_name' => 'civicrm_custom_group',
463 'entity' => 'CustomGroup',
464 'bao' => 'CRM_Core_BAO_CustomGroup',
469 'name' => 'max_multiple',
470 'type' => CRM_Utils_Type
::T_INT
,
471 'title' => ts('Maximum Multiple Records'),
472 'description' => ts('maximum number of multiple records, if 0 - no max'),
473 'where' => 'civicrm_custom_group.max_multiple',
474 'table_name' => 'civicrm_custom_group',
475 'entity' => 'CustomGroup',
476 'bao' => 'CRM_Core_BAO_CustomGroup',
480 'collapse_adv_display' => [
481 'name' => 'collapse_adv_display',
482 'type' => CRM_Utils_Type
::T_BOOLEAN
,
483 'title' => ts('Collapse Group Display'),
484 'description' => ts('Will this group be in collapsed or expanded mode on advanced search display ?'),
485 'where' => 'civicrm_custom_group.collapse_adv_display',
487 'table_name' => 'civicrm_custom_group',
488 'entity' => 'CustomGroup',
489 'bao' => 'CRM_Core_BAO_CustomGroup',
494 'name' => 'created_id',
495 'type' => CRM_Utils_Type
::T_INT
,
496 'title' => ts('Created By Contact ID'),
497 'description' => ts('FK to civicrm_contact, who created this custom group'),
498 'where' => 'civicrm_custom_group.created_id',
499 'table_name' => 'civicrm_custom_group',
500 'entity' => 'CustomGroup',
501 'bao' => 'CRM_Core_BAO_CustomGroup',
503 'FKClassName' => 'CRM_Contact_DAO_Contact',
505 'label' => ts("Created By"),
510 'name' => 'created_date',
511 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
512 'title' => ts('Custom Group Created Date'),
513 'description' => ts('Date and time this custom group was created.'),
514 'where' => 'civicrm_custom_group.created_date',
515 'table_name' => 'civicrm_custom_group',
516 'entity' => 'CustomGroup',
517 'bao' => 'CRM_Core_BAO_CustomGroup',
522 'name' => 'is_reserved',
523 'type' => CRM_Utils_Type
::T_BOOLEAN
,
524 'title' => ts('Reserved Group?'),
525 'description' => ts('Is this a reserved Custom Group?'),
526 'where' => 'civicrm_custom_group.is_reserved',
528 'table_name' => 'civicrm_custom_group',
529 'entity' => 'CustomGroup',
530 'bao' => 'CRM_Core_BAO_CustomGroup',
535 'name' => 'is_public',
536 'type' => CRM_Utils_Type
::T_BOOLEAN
,
537 'title' => ts('Custom Group Is Public?'),
538 'description' => ts('Is this property public?'),
539 'where' => 'civicrm_custom_group.is_public',
541 'table_name' => 'civicrm_custom_group',
542 'entity' => 'CustomGroup',
543 'bao' => 'CRM_Core_BAO_CustomGroup',
549 'type' => CRM_Utils_Type
::T_STRING
,
550 'title' => ts('Icon'),
551 'description' => ts('crm-i icon class'),
553 'size' => CRM_Utils_Type
::HUGE
,
554 'where' => 'civicrm_custom_group.icon',
556 'table_name' => 'civicrm_custom_group',
557 'entity' => 'CustomGroup',
558 'bao' => 'CRM_Core_BAO_CustomGroup',
563 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
565 return Civi
::$statics[__CLASS__
]['fields'];
569 * Return a mapping from field-name to the corresponding key (as used in fields()).
572 * Array(string $name => string $uniqueName).
574 public static function &fieldKeys() {
575 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
576 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
578 return Civi
::$statics[__CLASS__
]['fieldKeys'];
582 * Returns the names of this table
586 public static function getTableName() {
587 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
591 * Returns if this table needs to be logged
595 public function getLog() {
600 * Returns the list of fields that can be imported
602 * @param bool $prefix
606 public static function &import($prefix = FALSE) {
607 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'custom_group', $prefix, []);
612 * Returns the list of fields that can be exported
614 * @param bool $prefix
618 public static function &export($prefix = FALSE) {
619 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'custom_group', $prefix, []);
624 * Returns the list of indices
626 * @param bool $localize
630 public static function indices($localize = TRUE) {
632 'UI_title_extends' => [
633 'name' => 'UI_title_extends',
638 'localizable' => TRUE,
640 'sig' => 'civicrm_custom_group::1::title::extends',
642 'UI_name_extends' => [
643 'name' => 'UI_name_extends',
648 'localizable' => FALSE,
650 'sig' => 'civicrm_custom_group::1::name::extends',
653 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;