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:4f58c488f8213dab928db357bc88f478)
13 * Database access object for the CustomGroup entity.
15 class CRM_Core_DAO_CustomGroup
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_custom_group';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
32 * Unique Custom Group ID
39 * Variable name/programmatic handle for this group.
53 * Type of object this group extends (can add other options later e.g. contact_address, etc.).
60 * FK to civicrm_option_value.id (for option group custom_data_type.)
64 public $extends_entity_column_id;
67 * linking custom group for dynamic object
71 public $extends_entity_column_value;
74 * Visual relationship between this form and its parent.
81 * Will this group be in collapsed or expanded mode on initial display ?
85 public $collapse_display;
88 * Description and/or help text to display before fields in form.
95 * Description and/or help text to display after fields in form.
102 * Controls display order when multiple extended property groups are setup for the same class.
109 * Is this property active?
116 * Name of the table that holds the values for this group.
123 * Does this group hold multiple values?
130 * minimum number of multiple records (typically 0?)
134 public $min_multiple;
137 * maximum number of multiple records, if 0 - no max
141 public $max_multiple;
144 * Will this group be in collapsed or expanded mode on advanced search display ?
148 public $collapse_adv_display;
151 * FK to civicrm_contact, who created this custom group
158 * Date and time this custom group was created.
162 public $created_date;
165 * Is this a reserved Custom Group?
172 * Is this property public?
188 public function __construct() {
189 $this->__table
= 'civicrm_custom_group';
190 parent
::__construct();
194 * Returns localized title of this entity.
196 public static function getEntityTitle() {
197 return ts('Custom Groups');
201 * Returns foreign keys and entity references.
204 * [CRM_Core_Reference_Interface]
206 public static function getReferenceColumns() {
207 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
208 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
209 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
210 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
212 return Civi
::$statics[__CLASS__
]['links'];
216 * Returns all the column names of this table
220 public static function &fields() {
221 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
222 Civi
::$statics[__CLASS__
]['fields'] = [
225 'type' => CRM_Utils_Type
::T_INT
,
226 'title' => ts('Custom Group ID'),
227 'description' => ts('Unique Custom Group ID'),
229 'where' => 'civicrm_custom_group.id',
230 'table_name' => 'civicrm_custom_group',
231 'entity' => 'CustomGroup',
232 'bao' => 'CRM_Core_BAO_CustomGroup',
238 'type' => CRM_Utils_Type
::T_STRING
,
239 'title' => ts('Custom Group Name'),
240 'description' => ts('Variable name/programmatic handle for this group.'),
242 'size' => CRM_Utils_Type
::BIG
,
243 'where' => 'civicrm_custom_group.name',
244 'table_name' => 'civicrm_custom_group',
245 'entity' => 'CustomGroup',
246 'bao' => 'CRM_Core_BAO_CustomGroup',
252 'type' => CRM_Utils_Type
::T_STRING
,
253 'title' => ts('Custom Group Title'),
254 'description' => ts('Friendly Name.'),
257 'size' => CRM_Utils_Type
::BIG
,
258 'where' => 'civicrm_custom_group.title',
259 'table_name' => 'civicrm_custom_group',
260 'entity' => 'CustomGroup',
261 'bao' => 'CRM_Core_BAO_CustomGroup',
267 'type' => CRM_Utils_Type
::T_STRING
,
268 'title' => ts('Custom Group Extends'),
269 'description' => ts('Type of object this group extends (can add other options later e.g. contact_address, etc.).'),
271 'size' => CRM_Utils_Type
::HUGE
,
272 'where' => 'civicrm_custom_group.extends',
273 'default' => 'Contact',
274 'table_name' => 'civicrm_custom_group',
275 'entity' => 'CustomGroup',
276 'bao' => 'CRM_Core_BAO_CustomGroup',
280 'extends_entity_column_id' => [
281 'name' => 'extends_entity_column_id',
282 'type' => CRM_Utils_Type
::T_INT
,
283 'title' => ts('Custom Group Subtype List'),
284 'description' => ts('FK to civicrm_option_value.id (for option group custom_data_type.)'),
285 'where' => 'civicrm_custom_group.extends_entity_column_id',
287 'table_name' => 'civicrm_custom_group',
288 'entity' => 'CustomGroup',
289 'bao' => 'CRM_Core_BAO_CustomGroup',
294 'pseudoconstant' => [
295 'optionGroupName' => 'custom_data_type',
296 'optionEditPath' => 'civicrm/admin/options/custom_data_type',
300 'extends_entity_column_value' => [
301 'name' => 'extends_entity_column_value',
302 'type' => CRM_Utils_Type
::T_STRING
,
303 'title' => ts('Custom Group Subtype'),
304 'description' => ts('linking custom group for dynamic object'),
306 'size' => CRM_Utils_Type
::HUGE
,
307 'where' => 'civicrm_custom_group.extends_entity_column_value',
308 'table_name' => 'civicrm_custom_group',
309 'entity' => 'CustomGroup',
310 'bao' => 'CRM_Core_BAO_CustomGroup',
312 'serialize' => self
::SERIALIZE_SEPARATOR_BOOKEND
,
317 'type' => CRM_Utils_Type
::T_STRING
,
318 'title' => ts('Custom Group Style'),
319 'description' => ts('Visual relationship between this form and its parent.'),
321 'size' => CRM_Utils_Type
::TWELVE
,
322 'where' => 'civicrm_custom_group.style',
323 'table_name' => 'civicrm_custom_group',
324 'entity' => 'CustomGroup',
325 'bao' => 'CRM_Core_BAO_CustomGroup',
330 'pseudoconstant' => [
331 'callback' => 'CRM_Core_SelectValues::customGroupStyle',
335 'collapse_display' => [
336 'name' => 'collapse_display',
337 'type' => CRM_Utils_Type
::T_BOOLEAN
,
338 'title' => ts('Collapse Custom Group?'),
339 'description' => ts('Will this group be in collapsed or expanded mode on initial display ?'),
340 'where' => 'civicrm_custom_group.collapse_display',
342 'table_name' => 'civicrm_custom_group',
343 'entity' => 'CustomGroup',
344 'bao' => 'CRM_Core_BAO_CustomGroup',
349 'name' => 'help_pre',
350 'type' => CRM_Utils_Type
::T_TEXT
,
351 'title' => ts('Custom Group Pre Text'),
352 'description' => ts('Description and/or help text to display before fields in form.'),
355 'where' => 'civicrm_custom_group.help_pre',
356 'table_name' => 'civicrm_custom_group',
357 'entity' => 'CustomGroup',
358 'bao' => 'CRM_Core_BAO_CustomGroup',
361 'type' => 'TextArea',
366 'name' => 'help_post',
367 'type' => CRM_Utils_Type
::T_TEXT
,
368 'title' => ts('Custom Group Post Text'),
369 'description' => ts('Description and/or help text to display after fields in form.'),
372 'where' => 'civicrm_custom_group.help_post',
373 'table_name' => 'civicrm_custom_group',
374 'entity' => 'CustomGroup',
375 'bao' => 'CRM_Core_BAO_CustomGroup',
378 'type' => 'TextArea',
384 'type' => CRM_Utils_Type
::T_INT
,
385 'title' => ts('Order'),
386 'description' => ts('Controls display order when multiple extended property groups are setup for the same class.'),
388 'where' => 'civicrm_custom_group.weight',
390 'table_name' => 'civicrm_custom_group',
391 'entity' => 'CustomGroup',
392 'bao' => 'CRM_Core_BAO_CustomGroup',
397 'name' => 'is_active',
398 'type' => CRM_Utils_Type
::T_BOOLEAN
,
399 'title' => ts('Custom Group Is Active?'),
400 'description' => ts('Is this property active?'),
401 'where' => 'civicrm_custom_group.is_active',
403 'table_name' => 'civicrm_custom_group',
404 'entity' => 'CustomGroup',
405 'bao' => 'CRM_Core_BAO_CustomGroup',
410 'name' => 'table_name',
411 'type' => CRM_Utils_Type
::T_STRING
,
412 'title' => ts('Table Name'),
413 'description' => ts('Name of the table that holds the values for this group.'),
415 'size' => CRM_Utils_Type
::HUGE
,
416 'where' => 'civicrm_custom_group.table_name',
417 'table_name' => 'civicrm_custom_group',
418 'entity' => 'CustomGroup',
419 'bao' => 'CRM_Core_BAO_CustomGroup',
424 'name' => 'is_multiple',
425 'type' => CRM_Utils_Type
::T_BOOLEAN
,
426 'title' => ts('Supports Multiple Records'),
427 'description' => ts('Does this group hold multiple values?'),
428 'where' => 'civicrm_custom_group.is_multiple',
430 'table_name' => 'civicrm_custom_group',
431 'entity' => 'CustomGroup',
432 'bao' => 'CRM_Core_BAO_CustomGroup',
437 'name' => 'min_multiple',
438 'type' => CRM_Utils_Type
::T_INT
,
439 'title' => ts('Minimum Multiple Records'),
440 'description' => ts('minimum number of multiple records (typically 0?)'),
441 'where' => 'civicrm_custom_group.min_multiple',
442 'table_name' => 'civicrm_custom_group',
443 'entity' => 'CustomGroup',
444 'bao' => 'CRM_Core_BAO_CustomGroup',
449 'name' => 'max_multiple',
450 'type' => CRM_Utils_Type
::T_INT
,
451 'title' => ts('Maximum Multiple Records'),
452 'description' => ts('maximum number of multiple records, if 0 - no max'),
453 'where' => 'civicrm_custom_group.max_multiple',
454 'table_name' => 'civicrm_custom_group',
455 'entity' => 'CustomGroup',
456 'bao' => 'CRM_Core_BAO_CustomGroup',
460 'collapse_adv_display' => [
461 'name' => 'collapse_adv_display',
462 'type' => CRM_Utils_Type
::T_BOOLEAN
,
463 'title' => ts('Collapse Group Display'),
464 'description' => ts('Will this group be in collapsed or expanded mode on advanced search display ?'),
465 'where' => 'civicrm_custom_group.collapse_adv_display',
467 'table_name' => 'civicrm_custom_group',
468 'entity' => 'CustomGroup',
469 'bao' => 'CRM_Core_BAO_CustomGroup',
474 'name' => 'created_id',
475 'type' => CRM_Utils_Type
::T_INT
,
476 'title' => ts('Custom Group Created By'),
477 'description' => ts('FK to civicrm_contact, who created this custom group'),
478 'where' => 'civicrm_custom_group.created_id',
479 'table_name' => 'civicrm_custom_group',
480 'entity' => 'CustomGroup',
481 'bao' => 'CRM_Core_BAO_CustomGroup',
483 'FKClassName' => 'CRM_Contact_DAO_Contact',
487 'name' => 'created_date',
488 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
489 'title' => ts('Custom Group Created Date'),
490 'description' => ts('Date and time this custom group was created.'),
491 'where' => 'civicrm_custom_group.created_date',
492 'table_name' => 'civicrm_custom_group',
493 'entity' => 'CustomGroup',
494 'bao' => 'CRM_Core_BAO_CustomGroup',
499 'name' => 'is_reserved',
500 'type' => CRM_Utils_Type
::T_BOOLEAN
,
501 'title' => ts('Reserved Group?'),
502 'description' => ts('Is this a reserved Custom Group?'),
503 'where' => 'civicrm_custom_group.is_reserved',
505 'table_name' => 'civicrm_custom_group',
506 'entity' => 'CustomGroup',
507 'bao' => 'CRM_Core_BAO_CustomGroup',
512 'name' => 'is_public',
513 'type' => CRM_Utils_Type
::T_BOOLEAN
,
514 'title' => ts('Custom Group Is Public?'),
515 'description' => ts('Is this property public?'),
516 'where' => 'civicrm_custom_group.is_public',
518 'table_name' => 'civicrm_custom_group',
519 'entity' => 'CustomGroup',
520 'bao' => 'CRM_Core_BAO_CustomGroup',
526 'type' => CRM_Utils_Type
::T_STRING
,
527 'title' => ts('Icon'),
528 'description' => ts('crm-i icon class'),
530 'size' => CRM_Utils_Type
::HUGE
,
531 'where' => 'civicrm_custom_group.icon',
533 'table_name' => 'civicrm_custom_group',
534 'entity' => 'CustomGroup',
535 'bao' => 'CRM_Core_BAO_CustomGroup',
540 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
542 return Civi
::$statics[__CLASS__
]['fields'];
546 * Return a mapping from field-name to the corresponding key (as used in fields()).
549 * Array(string $name => string $uniqueName).
551 public static function &fieldKeys() {
552 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
553 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
555 return Civi
::$statics[__CLASS__
]['fieldKeys'];
559 * Returns the names of this table
563 public static function getTableName() {
564 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
568 * Returns if this table needs to be logged
572 public function getLog() {
577 * Returns the list of fields that can be imported
579 * @param bool $prefix
583 public static function &import($prefix = FALSE) {
584 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'custom_group', $prefix, []);
589 * Returns the list of fields that can be exported
591 * @param bool $prefix
595 public static function &export($prefix = FALSE) {
596 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'custom_group', $prefix, []);
601 * Returns the list of indices
603 * @param bool $localize
607 public static function indices($localize = TRUE) {
609 'UI_title_extends' => [
610 'name' => 'UI_title_extends',
615 'localizable' => TRUE,
617 'sig' => 'civicrm_custom_group::1::title::extends',
619 'UI_name_extends' => [
620 'name' => 'UI_name_extends',
625 'localizable' => FALSE,
627 'sig' => 'civicrm_custom_group::1::name::extends',
630 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;