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:325f7ef398cd08e7576f634d9923f129)
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',
250 'type' => CRM_Utils_Type
::T_STRING
,
251 'title' => ts('Custom Group Name'),
252 'description' => ts('Variable name/programmatic handle for this group.'),
254 'size' => CRM_Utils_Type
::BIG
,
255 'where' => 'civicrm_custom_group.name',
256 'table_name' => 'civicrm_custom_group',
257 'entity' => 'CustomGroup',
258 'bao' => 'CRM_Core_BAO_CustomGroup',
264 'type' => CRM_Utils_Type
::T_STRING
,
265 'title' => ts('Custom Group Title'),
266 'description' => ts('Friendly Name.'),
269 'size' => CRM_Utils_Type
::BIG
,
270 'where' => 'civicrm_custom_group.title',
271 'table_name' => 'civicrm_custom_group',
272 'entity' => 'CustomGroup',
273 'bao' => 'CRM_Core_BAO_CustomGroup',
279 'type' => CRM_Utils_Type
::T_STRING
,
280 'title' => ts('Custom Group Extends'),
281 'description' => ts('Type of object this group extends (can add other options later e.g. contact_address, etc.).'),
283 'size' => CRM_Utils_Type
::HUGE
,
284 'where' => 'civicrm_custom_group.extends',
285 'default' => 'Contact',
286 'table_name' => 'civicrm_custom_group',
287 'entity' => 'CustomGroup',
288 'bao' => 'CRM_Core_BAO_CustomGroup',
292 'extends_entity_column_id' => [
293 'name' => 'extends_entity_column_id',
294 'type' => CRM_Utils_Type
::T_INT
,
295 'title' => ts('Custom Group Subtype List'),
296 'description' => ts('FK to civicrm_option_value.id (for option group custom_data_type.)'),
297 'where' => 'civicrm_custom_group.extends_entity_column_id',
299 'table_name' => 'civicrm_custom_group',
300 'entity' => 'CustomGroup',
301 'bao' => 'CRM_Core_BAO_CustomGroup',
306 'pseudoconstant' => [
307 'optionGroupName' => 'custom_data_type',
308 'optionEditPath' => 'civicrm/admin/options/custom_data_type',
312 'extends_entity_column_value' => [
313 'name' => 'extends_entity_column_value',
314 'type' => CRM_Utils_Type
::T_STRING
,
315 'title' => ts('Custom Group Subtype'),
316 'description' => ts('linking custom group for dynamic object'),
318 'size' => CRM_Utils_Type
::HUGE
,
319 'where' => 'civicrm_custom_group.extends_entity_column_value',
320 'table_name' => 'civicrm_custom_group',
321 'entity' => 'CustomGroup',
322 'bao' => 'CRM_Core_BAO_CustomGroup',
324 'serialize' => self
::SERIALIZE_SEPARATOR_BOOKEND
,
329 'type' => CRM_Utils_Type
::T_STRING
,
330 'title' => ts('Custom Group Style'),
331 'description' => ts('Visual relationship between this form and its parent.'),
333 'size' => CRM_Utils_Type
::TWELVE
,
334 'where' => 'civicrm_custom_group.style',
335 'table_name' => 'civicrm_custom_group',
336 'entity' => 'CustomGroup',
337 'bao' => 'CRM_Core_BAO_CustomGroup',
342 'pseudoconstant' => [
343 'callback' => 'CRM_Core_SelectValues::customGroupStyle',
347 'collapse_display' => [
348 'name' => 'collapse_display',
349 'type' => CRM_Utils_Type
::T_BOOLEAN
,
350 'title' => ts('Collapse Custom Group?'),
351 'description' => ts('Will this group be in collapsed or expanded mode on initial display ?'),
352 'where' => 'civicrm_custom_group.collapse_display',
354 'table_name' => 'civicrm_custom_group',
355 'entity' => 'CustomGroup',
356 'bao' => 'CRM_Core_BAO_CustomGroup',
361 'name' => 'help_pre',
362 'type' => CRM_Utils_Type
::T_TEXT
,
363 'title' => ts('Custom Group Pre Text'),
364 'description' => ts('Description and/or help text to display before fields in form.'),
367 'where' => 'civicrm_custom_group.help_pre',
368 'table_name' => 'civicrm_custom_group',
369 'entity' => 'CustomGroup',
370 'bao' => 'CRM_Core_BAO_CustomGroup',
373 'type' => 'TextArea',
378 'name' => 'help_post',
379 'type' => CRM_Utils_Type
::T_TEXT
,
380 'title' => ts('Custom Group Post Text'),
381 'description' => ts('Description and/or help text to display after fields in form.'),
384 'where' => 'civicrm_custom_group.help_post',
385 'table_name' => 'civicrm_custom_group',
386 'entity' => 'CustomGroup',
387 'bao' => 'CRM_Core_BAO_CustomGroup',
390 'type' => 'TextArea',
396 'type' => CRM_Utils_Type
::T_INT
,
397 'title' => ts('Order'),
398 'description' => ts('Controls display order when multiple extended property groups are setup for the same class.'),
400 'where' => 'civicrm_custom_group.weight',
402 'table_name' => 'civicrm_custom_group',
403 'entity' => 'CustomGroup',
404 'bao' => 'CRM_Core_BAO_CustomGroup',
409 'name' => 'is_active',
410 'type' => CRM_Utils_Type
::T_BOOLEAN
,
411 'title' => ts('Custom Group Is Active?'),
412 'description' => ts('Is this property active?'),
413 'where' => 'civicrm_custom_group.is_active',
415 'table_name' => 'civicrm_custom_group',
416 'entity' => 'CustomGroup',
417 'bao' => 'CRM_Core_BAO_CustomGroup',
422 'name' => 'table_name',
423 'type' => CRM_Utils_Type
::T_STRING
,
424 'title' => ts('Table Name'),
425 'description' => ts('Name of the table that holds the values for this group.'),
427 'size' => CRM_Utils_Type
::HUGE
,
428 'where' => 'civicrm_custom_group.table_name',
429 'table_name' => 'civicrm_custom_group',
430 'entity' => 'CustomGroup',
431 'bao' => 'CRM_Core_BAO_CustomGroup',
436 'name' => 'is_multiple',
437 'type' => CRM_Utils_Type
::T_BOOLEAN
,
438 'title' => ts('Supports Multiple Records'),
439 'description' => ts('Does this group hold multiple values?'),
440 'where' => 'civicrm_custom_group.is_multiple',
442 'table_name' => 'civicrm_custom_group',
443 'entity' => 'CustomGroup',
444 'bao' => 'CRM_Core_BAO_CustomGroup',
449 'name' => 'min_multiple',
450 'type' => CRM_Utils_Type
::T_INT
,
451 'title' => ts('Minimum Multiple Records'),
452 'description' => ts('minimum number of multiple records (typically 0?)'),
453 'where' => 'civicrm_custom_group.min_multiple',
454 'table_name' => 'civicrm_custom_group',
455 'entity' => 'CustomGroup',
456 'bao' => 'CRM_Core_BAO_CustomGroup',
461 'name' => 'max_multiple',
462 'type' => CRM_Utils_Type
::T_INT
,
463 'title' => ts('Maximum Multiple Records'),
464 'description' => ts('maximum number of multiple records, if 0 - no max'),
465 'where' => 'civicrm_custom_group.max_multiple',
466 'table_name' => 'civicrm_custom_group',
467 'entity' => 'CustomGroup',
468 'bao' => 'CRM_Core_BAO_CustomGroup',
472 'collapse_adv_display' => [
473 'name' => 'collapse_adv_display',
474 'type' => CRM_Utils_Type
::T_BOOLEAN
,
475 'title' => ts('Collapse Group Display'),
476 'description' => ts('Will this group be in collapsed or expanded mode on advanced search display ?'),
477 'where' => 'civicrm_custom_group.collapse_adv_display',
479 'table_name' => 'civicrm_custom_group',
480 'entity' => 'CustomGroup',
481 'bao' => 'CRM_Core_BAO_CustomGroup',
486 'name' => 'created_id',
487 'type' => CRM_Utils_Type
::T_INT
,
488 'title' => ts('Custom Group Created By'),
489 'description' => ts('FK to civicrm_contact, who created this custom group'),
490 'where' => 'civicrm_custom_group.created_id',
491 'table_name' => 'civicrm_custom_group',
492 'entity' => 'CustomGroup',
493 'bao' => 'CRM_Core_BAO_CustomGroup',
495 'FKClassName' => 'CRM_Contact_DAO_Contact',
499 'name' => 'created_date',
500 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
501 'title' => ts('Custom Group Created Date'),
502 'description' => ts('Date and time this custom group was created.'),
503 'where' => 'civicrm_custom_group.created_date',
504 'table_name' => 'civicrm_custom_group',
505 'entity' => 'CustomGroup',
506 'bao' => 'CRM_Core_BAO_CustomGroup',
511 'name' => 'is_reserved',
512 'type' => CRM_Utils_Type
::T_BOOLEAN
,
513 'title' => ts('Reserved Group?'),
514 'description' => ts('Is this a reserved Custom Group?'),
515 'where' => 'civicrm_custom_group.is_reserved',
517 'table_name' => 'civicrm_custom_group',
518 'entity' => 'CustomGroup',
519 'bao' => 'CRM_Core_BAO_CustomGroup',
524 'name' => 'is_public',
525 'type' => CRM_Utils_Type
::T_BOOLEAN
,
526 'title' => ts('Custom Group Is Public?'),
527 'description' => ts('Is this property public?'),
528 'where' => 'civicrm_custom_group.is_public',
530 'table_name' => 'civicrm_custom_group',
531 'entity' => 'CustomGroup',
532 'bao' => 'CRM_Core_BAO_CustomGroup',
538 'type' => CRM_Utils_Type
::T_STRING
,
539 'title' => ts('Icon'),
540 'description' => ts('crm-i icon class'),
542 'size' => CRM_Utils_Type
::HUGE
,
543 'where' => 'civicrm_custom_group.icon',
545 'table_name' => 'civicrm_custom_group',
546 'entity' => 'CustomGroup',
547 'bao' => 'CRM_Core_BAO_CustomGroup',
552 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
554 return Civi
::$statics[__CLASS__
]['fields'];
558 * Return a mapping from field-name to the corresponding key (as used in fields()).
561 * Array(string $name => string $uniqueName).
563 public static function &fieldKeys() {
564 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
565 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
567 return Civi
::$statics[__CLASS__
]['fieldKeys'];
571 * Returns the names of this table
575 public static function getTableName() {
576 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
580 * Returns if this table needs to be logged
584 public function getLog() {
589 * Returns the list of fields that can be imported
591 * @param bool $prefix
595 public static function &import($prefix = FALSE) {
596 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'custom_group', $prefix, []);
601 * Returns the list of fields that can be exported
603 * @param bool $prefix
607 public static function &export($prefix = FALSE) {
608 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'custom_group', $prefix, []);
613 * Returns the list of indices
615 * @param bool $localize
619 public static function indices($localize = TRUE) {
621 'UI_title_extends' => [
622 'name' => 'UI_title_extends',
627 'localizable' => TRUE,
629 'sig' => 'civicrm_custom_group::1::title::extends',
631 'UI_name_extends' => [
632 'name' => 'UI_name_extends',
637 'localizable' => FALSE,
639 'sig' => 'civicrm_custom_group::1::name::extends',
642 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;