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:3436e2a4cf99bd9b7c859170db37bce3)
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 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
34 * Unique Custom Group ID
41 * Variable name/programmatic handle for this group.
55 * Type of object this group extends (can add other options later e.g. contact_address, etc.).
62 * FK to civicrm_option_value.id (for option group custom_data_type.)
66 public $extends_entity_column_id;
69 * linking custom group for dynamic object
73 public $extends_entity_column_value;
76 * Visual relationship between this form and its parent.
83 * Will this group be in collapsed or expanded mode on initial display ?
87 public $collapse_display;
90 * Description and/or help text to display before fields in form.
97 * Description and/or help text to display after fields in form.
104 * Controls display order when multiple extended property groups are setup for the same class.
111 * Is this property active?
118 * Name of the table that holds the values for this group.
125 * Does this group hold multiple values?
132 * minimum number of multiple records (typically 0?)
136 public $min_multiple;
139 * maximum number of multiple records, if 0 - no max
143 public $max_multiple;
146 * Will this group be in collapsed or expanded mode on advanced search display ?
150 public $collapse_adv_display;
153 * FK to civicrm_contact, who created this custom group
160 * Date and time this custom group was created.
164 public $created_date;
167 * Is this a reserved Custom Group?
174 * Is this property public?
190 public function __construct() {
191 $this->__table
= 'civicrm_custom_group';
192 parent
::__construct();
196 * Returns localized title of this entity.
198 * @param bool $plural
199 * Whether to return the plural version of the title.
201 public static function getEntityTitle($plural = FALSE) {
202 return $plural ?
ts('Custom Groups') : ts('Custom Group');
206 * Returns foreign keys and entity references.
209 * [CRM_Core_Reference_Interface]
211 public static function getReferenceColumns() {
212 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
213 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
214 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
215 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
217 return Civi
::$statics[__CLASS__
]['links'];
221 * Returns all the column names of this table
225 public static function &fields() {
226 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
227 Civi
::$statics[__CLASS__
]['fields'] = [
230 'type' => CRM_Utils_Type
::T_INT
,
231 'title' => ts('Custom Group ID'),
232 'description' => ts('Unique Custom Group ID'),
234 'where' => 'civicrm_custom_group.id',
235 'table_name' => 'civicrm_custom_group',
236 'entity' => 'CustomGroup',
237 'bao' => 'CRM_Core_BAO_CustomGroup',
243 'type' => CRM_Utils_Type
::T_STRING
,
244 'title' => ts('Custom Group Name'),
245 'description' => ts('Variable name/programmatic handle for this group.'),
247 'size' => CRM_Utils_Type
::BIG
,
248 'where' => 'civicrm_custom_group.name',
249 'table_name' => 'civicrm_custom_group',
250 'entity' => 'CustomGroup',
251 'bao' => 'CRM_Core_BAO_CustomGroup',
257 'type' => CRM_Utils_Type
::T_STRING
,
258 'title' => ts('Custom Group Title'),
259 'description' => ts('Friendly Name.'),
262 'size' => CRM_Utils_Type
::BIG
,
263 'where' => 'civicrm_custom_group.title',
264 'table_name' => 'civicrm_custom_group',
265 'entity' => 'CustomGroup',
266 'bao' => 'CRM_Core_BAO_CustomGroup',
272 'type' => CRM_Utils_Type
::T_STRING
,
273 'title' => ts('Custom Group Extends'),
274 'description' => ts('Type of object this group extends (can add other options later e.g. contact_address, etc.).'),
276 'size' => CRM_Utils_Type
::HUGE
,
277 'where' => 'civicrm_custom_group.extends',
278 'default' => 'Contact',
279 'table_name' => 'civicrm_custom_group',
280 'entity' => 'CustomGroup',
281 'bao' => 'CRM_Core_BAO_CustomGroup',
285 'extends_entity_column_id' => [
286 'name' => 'extends_entity_column_id',
287 'type' => CRM_Utils_Type
::T_INT
,
288 'title' => ts('Custom Group Subtype List'),
289 'description' => ts('FK to civicrm_option_value.id (for option group custom_data_type.)'),
290 'where' => 'civicrm_custom_group.extends_entity_column_id',
292 'table_name' => 'civicrm_custom_group',
293 'entity' => 'CustomGroup',
294 'bao' => 'CRM_Core_BAO_CustomGroup',
299 'pseudoconstant' => [
300 'optionGroupName' => 'custom_data_type',
301 'optionEditPath' => 'civicrm/admin/options/custom_data_type',
305 'extends_entity_column_value' => [
306 'name' => 'extends_entity_column_value',
307 'type' => CRM_Utils_Type
::T_STRING
,
308 'title' => ts('Custom Group Subtype'),
309 'description' => ts('linking custom group for dynamic object'),
311 'size' => CRM_Utils_Type
::HUGE
,
312 'where' => 'civicrm_custom_group.extends_entity_column_value',
313 'table_name' => 'civicrm_custom_group',
314 'entity' => 'CustomGroup',
315 'bao' => 'CRM_Core_BAO_CustomGroup',
317 'serialize' => self
::SERIALIZE_SEPARATOR_BOOKEND
,
322 'type' => CRM_Utils_Type
::T_STRING
,
323 'title' => ts('Custom Group Style'),
324 'description' => ts('Visual relationship between this form and its parent.'),
326 'size' => CRM_Utils_Type
::TWELVE
,
327 'where' => 'civicrm_custom_group.style',
328 'table_name' => 'civicrm_custom_group',
329 'entity' => 'CustomGroup',
330 'bao' => 'CRM_Core_BAO_CustomGroup',
335 'pseudoconstant' => [
336 'callback' => 'CRM_Core_SelectValues::customGroupStyle',
340 'collapse_display' => [
341 'name' => 'collapse_display',
342 'type' => CRM_Utils_Type
::T_BOOLEAN
,
343 'title' => ts('Collapse Custom Group?'),
344 'description' => ts('Will this group be in collapsed or expanded mode on initial display ?'),
345 'where' => 'civicrm_custom_group.collapse_display',
347 'table_name' => 'civicrm_custom_group',
348 'entity' => 'CustomGroup',
349 'bao' => 'CRM_Core_BAO_CustomGroup',
354 'name' => 'help_pre',
355 'type' => CRM_Utils_Type
::T_TEXT
,
356 'title' => ts('Custom Group Pre Text'),
357 'description' => ts('Description and/or help text to display before fields in form.'),
360 'where' => 'civicrm_custom_group.help_pre',
361 'table_name' => 'civicrm_custom_group',
362 'entity' => 'CustomGroup',
363 'bao' => 'CRM_Core_BAO_CustomGroup',
366 'type' => 'TextArea',
371 'name' => 'help_post',
372 'type' => CRM_Utils_Type
::T_TEXT
,
373 'title' => ts('Custom Group Post Text'),
374 'description' => ts('Description and/or help text to display after fields in form.'),
377 'where' => 'civicrm_custom_group.help_post',
378 'table_name' => 'civicrm_custom_group',
379 'entity' => 'CustomGroup',
380 'bao' => 'CRM_Core_BAO_CustomGroup',
383 'type' => 'TextArea',
389 'type' => CRM_Utils_Type
::T_INT
,
390 'title' => ts('Order'),
391 'description' => ts('Controls display order when multiple extended property groups are setup for the same class.'),
393 'where' => 'civicrm_custom_group.weight',
395 'table_name' => 'civicrm_custom_group',
396 'entity' => 'CustomGroup',
397 'bao' => 'CRM_Core_BAO_CustomGroup',
402 'name' => 'is_active',
403 'type' => CRM_Utils_Type
::T_BOOLEAN
,
404 'title' => ts('Custom Group Is Active?'),
405 'description' => ts('Is this property active?'),
406 'where' => 'civicrm_custom_group.is_active',
408 'table_name' => 'civicrm_custom_group',
409 'entity' => 'CustomGroup',
410 'bao' => 'CRM_Core_BAO_CustomGroup',
415 'name' => 'table_name',
416 'type' => CRM_Utils_Type
::T_STRING
,
417 'title' => ts('Table Name'),
418 'description' => ts('Name of the table that holds the values for this group.'),
420 'size' => CRM_Utils_Type
::HUGE
,
421 'where' => 'civicrm_custom_group.table_name',
422 'table_name' => 'civicrm_custom_group',
423 'entity' => 'CustomGroup',
424 'bao' => 'CRM_Core_BAO_CustomGroup',
429 'name' => 'is_multiple',
430 'type' => CRM_Utils_Type
::T_BOOLEAN
,
431 'title' => ts('Supports Multiple Records'),
432 'description' => ts('Does this group hold multiple values?'),
433 'where' => 'civicrm_custom_group.is_multiple',
435 'table_name' => 'civicrm_custom_group',
436 'entity' => 'CustomGroup',
437 'bao' => 'CRM_Core_BAO_CustomGroup',
442 'name' => 'min_multiple',
443 'type' => CRM_Utils_Type
::T_INT
,
444 'title' => ts('Minimum Multiple Records'),
445 'description' => ts('minimum number of multiple records (typically 0?)'),
446 'where' => 'civicrm_custom_group.min_multiple',
447 'table_name' => 'civicrm_custom_group',
448 'entity' => 'CustomGroup',
449 'bao' => 'CRM_Core_BAO_CustomGroup',
454 'name' => 'max_multiple',
455 'type' => CRM_Utils_Type
::T_INT
,
456 'title' => ts('Maximum Multiple Records'),
457 'description' => ts('maximum number of multiple records, if 0 - no max'),
458 'where' => 'civicrm_custom_group.max_multiple',
459 'table_name' => 'civicrm_custom_group',
460 'entity' => 'CustomGroup',
461 'bao' => 'CRM_Core_BAO_CustomGroup',
465 'collapse_adv_display' => [
466 'name' => 'collapse_adv_display',
467 'type' => CRM_Utils_Type
::T_BOOLEAN
,
468 'title' => ts('Collapse Group Display'),
469 'description' => ts('Will this group be in collapsed or expanded mode on advanced search display ?'),
470 'where' => 'civicrm_custom_group.collapse_adv_display',
472 'table_name' => 'civicrm_custom_group',
473 'entity' => 'CustomGroup',
474 'bao' => 'CRM_Core_BAO_CustomGroup',
479 'name' => 'created_id',
480 'type' => CRM_Utils_Type
::T_INT
,
481 'title' => ts('Custom Group Created By'),
482 'description' => ts('FK to civicrm_contact, who created this custom group'),
483 'where' => 'civicrm_custom_group.created_id',
484 'table_name' => 'civicrm_custom_group',
485 'entity' => 'CustomGroup',
486 'bao' => 'CRM_Core_BAO_CustomGroup',
488 'FKClassName' => 'CRM_Contact_DAO_Contact',
492 'name' => 'created_date',
493 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
494 'title' => ts('Custom Group Created Date'),
495 'description' => ts('Date and time this custom group was created.'),
496 'where' => 'civicrm_custom_group.created_date',
497 'table_name' => 'civicrm_custom_group',
498 'entity' => 'CustomGroup',
499 'bao' => 'CRM_Core_BAO_CustomGroup',
504 'name' => 'is_reserved',
505 'type' => CRM_Utils_Type
::T_BOOLEAN
,
506 'title' => ts('Reserved Group?'),
507 'description' => ts('Is this a reserved Custom Group?'),
508 'where' => 'civicrm_custom_group.is_reserved',
510 'table_name' => 'civicrm_custom_group',
511 'entity' => 'CustomGroup',
512 'bao' => 'CRM_Core_BAO_CustomGroup',
517 'name' => 'is_public',
518 'type' => CRM_Utils_Type
::T_BOOLEAN
,
519 'title' => ts('Custom Group Is Public?'),
520 'description' => ts('Is this property public?'),
521 'where' => 'civicrm_custom_group.is_public',
523 'table_name' => 'civicrm_custom_group',
524 'entity' => 'CustomGroup',
525 'bao' => 'CRM_Core_BAO_CustomGroup',
531 'type' => CRM_Utils_Type
::T_STRING
,
532 'title' => ts('Icon'),
533 'description' => ts('crm-i icon class'),
535 'size' => CRM_Utils_Type
::HUGE
,
536 'where' => 'civicrm_custom_group.icon',
538 'table_name' => 'civicrm_custom_group',
539 'entity' => 'CustomGroup',
540 'bao' => 'CRM_Core_BAO_CustomGroup',
545 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
547 return Civi
::$statics[__CLASS__
]['fields'];
551 * Return a mapping from field-name to the corresponding key (as used in fields()).
554 * Array(string $name => string $uniqueName).
556 public static function &fieldKeys() {
557 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
558 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
560 return Civi
::$statics[__CLASS__
]['fieldKeys'];
564 * Returns the names of this table
568 public static function getTableName() {
569 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
573 * Returns if this table needs to be logged
577 public function getLog() {
582 * Returns the list of fields that can be imported
584 * @param bool $prefix
588 public static function &import($prefix = FALSE) {
589 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'custom_group', $prefix, []);
594 * Returns the list of fields that can be exported
596 * @param bool $prefix
600 public static function &export($prefix = FALSE) {
601 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'custom_group', $prefix, []);
606 * Returns the list of indices
608 * @param bool $localize
612 public static function indices($localize = TRUE) {
614 'UI_title_extends' => [
615 'name' => 'UI_title_extends',
620 'localizable' => TRUE,
622 'sig' => 'civicrm_custom_group::1::title::extends',
624 'UI_name_extends' => [
625 'name' => 'UI_name_extends',
630 'localizable' => FALSE,
632 'sig' => 'civicrm_custom_group::1::name::extends',
635 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;