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:db4bf2393a66e6df5ec2a504b2cf6b3d)
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?
181 public function __construct() {
182 $this->__table
= 'civicrm_custom_group';
183 parent
::__construct();
187 * Returns localized title of this entity.
189 public static function getEntityTitle() {
190 return ts('Custom Groups');
194 * Returns foreign keys and entity references.
197 * [CRM_Core_Reference_Interface]
199 public static function getReferenceColumns() {
200 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
201 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
202 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
203 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
205 return Civi
::$statics[__CLASS__
]['links'];
209 * Returns all the column names of this table
213 public static function &fields() {
214 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
215 Civi
::$statics[__CLASS__
]['fields'] = [
218 'type' => CRM_Utils_Type
::T_INT
,
219 'title' => ts('Custom Group ID'),
220 'description' => ts('Unique Custom Group ID'),
222 'where' => 'civicrm_custom_group.id',
223 'table_name' => 'civicrm_custom_group',
224 'entity' => 'CustomGroup',
225 'bao' => 'CRM_Core_BAO_CustomGroup',
230 'type' => CRM_Utils_Type
::T_STRING
,
231 'title' => ts('Custom Group Name'),
232 'description' => ts('Variable name/programmatic handle for this group.'),
234 'size' => CRM_Utils_Type
::BIG
,
235 'where' => 'civicrm_custom_group.name',
236 'table_name' => 'civicrm_custom_group',
237 'entity' => 'CustomGroup',
238 'bao' => 'CRM_Core_BAO_CustomGroup',
243 'type' => CRM_Utils_Type
::T_STRING
,
244 'title' => ts('Custom Group Title'),
245 'description' => ts('Friendly Name.'),
248 'size' => CRM_Utils_Type
::BIG
,
249 'where' => 'civicrm_custom_group.title',
250 'table_name' => 'civicrm_custom_group',
251 'entity' => 'CustomGroup',
252 'bao' => 'CRM_Core_BAO_CustomGroup',
257 'type' => CRM_Utils_Type
::T_STRING
,
258 'title' => ts('Custom Group Extends'),
259 'description' => ts('Type of object this group extends (can add other options later e.g. contact_address, etc.).'),
261 'size' => CRM_Utils_Type
::HUGE
,
262 'where' => 'civicrm_custom_group.extends',
263 'default' => 'Contact',
264 'table_name' => 'civicrm_custom_group',
265 'entity' => 'CustomGroup',
266 'bao' => 'CRM_Core_BAO_CustomGroup',
269 'extends_entity_column_id' => [
270 'name' => 'extends_entity_column_id',
271 'type' => CRM_Utils_Type
::T_INT
,
272 'title' => ts('Custom Group Subtype List'),
273 'description' => ts('FK to civicrm_option_value.id (for option group custom_data_type.)'),
274 'where' => 'civicrm_custom_group.extends_entity_column_id',
276 'table_name' => 'civicrm_custom_group',
277 'entity' => 'CustomGroup',
278 'bao' => 'CRM_Core_BAO_CustomGroup',
283 'pseudoconstant' => [
284 'optionGroupName' => 'custom_data_type',
285 'optionEditPath' => 'civicrm/admin/options/custom_data_type',
288 'extends_entity_column_value' => [
289 'name' => 'extends_entity_column_value',
290 'type' => CRM_Utils_Type
::T_STRING
,
291 'title' => ts('Custom Group Subtype'),
292 'description' => ts('linking custom group for dynamic object'),
294 'size' => CRM_Utils_Type
::HUGE
,
295 'where' => 'civicrm_custom_group.extends_entity_column_value',
296 'table_name' => 'civicrm_custom_group',
297 'entity' => 'CustomGroup',
298 'bao' => 'CRM_Core_BAO_CustomGroup',
300 'serialize' => self
::SERIALIZE_SEPARATOR_BOOKEND
,
304 'type' => CRM_Utils_Type
::T_STRING
,
305 'title' => ts('Custom Group Style'),
306 'description' => ts('Visual relationship between this form and its parent.'),
308 'size' => CRM_Utils_Type
::TWELVE
,
309 'where' => 'civicrm_custom_group.style',
310 'table_name' => 'civicrm_custom_group',
311 'entity' => 'CustomGroup',
312 'bao' => 'CRM_Core_BAO_CustomGroup',
317 'pseudoconstant' => [
318 'callback' => 'CRM_Core_SelectValues::customGroupStyle',
321 'collapse_display' => [
322 'name' => 'collapse_display',
323 'type' => CRM_Utils_Type
::T_BOOLEAN
,
324 'title' => ts('Collapse Custom Group?'),
325 'description' => ts('Will this group be in collapsed or expanded mode on initial display ?'),
326 'where' => 'civicrm_custom_group.collapse_display',
328 'table_name' => 'civicrm_custom_group',
329 'entity' => 'CustomGroup',
330 'bao' => 'CRM_Core_BAO_CustomGroup',
334 'name' => 'help_pre',
335 'type' => CRM_Utils_Type
::T_TEXT
,
336 'title' => ts('Custom Group Pre Text'),
337 'description' => ts('Description and/or help text to display before fields in form.'),
340 'where' => 'civicrm_custom_group.help_pre',
341 'table_name' => 'civicrm_custom_group',
342 'entity' => 'CustomGroup',
343 'bao' => 'CRM_Core_BAO_CustomGroup',
346 'type' => 'TextArea',
350 'name' => 'help_post',
351 'type' => CRM_Utils_Type
::T_TEXT
,
352 'title' => ts('Custom Group Post Text'),
353 'description' => ts('Description and/or help text to display after fields in form.'),
356 'where' => 'civicrm_custom_group.help_post',
357 'table_name' => 'civicrm_custom_group',
358 'entity' => 'CustomGroup',
359 'bao' => 'CRM_Core_BAO_CustomGroup',
362 'type' => 'TextArea',
367 'type' => CRM_Utils_Type
::T_INT
,
368 'title' => ts('Order'),
369 'description' => ts('Controls display order when multiple extended property groups are setup for the same class.'),
371 'where' => 'civicrm_custom_group.weight',
373 'table_name' => 'civicrm_custom_group',
374 'entity' => 'CustomGroup',
375 'bao' => 'CRM_Core_BAO_CustomGroup',
379 'name' => 'is_active',
380 'type' => CRM_Utils_Type
::T_BOOLEAN
,
381 'title' => ts('Custom Group Is Active?'),
382 'description' => ts('Is this property active?'),
383 'where' => 'civicrm_custom_group.is_active',
385 'table_name' => 'civicrm_custom_group',
386 'entity' => 'CustomGroup',
387 'bao' => 'CRM_Core_BAO_CustomGroup',
391 'name' => 'table_name',
392 'type' => CRM_Utils_Type
::T_STRING
,
393 'title' => ts('Table Name'),
394 'description' => ts('Name of the table that holds the values for this group.'),
396 'size' => CRM_Utils_Type
::HUGE
,
397 'where' => 'civicrm_custom_group.table_name',
398 'table_name' => 'civicrm_custom_group',
399 'entity' => 'CustomGroup',
400 'bao' => 'CRM_Core_BAO_CustomGroup',
404 'name' => 'is_multiple',
405 'type' => CRM_Utils_Type
::T_BOOLEAN
,
406 'title' => ts('Supports Multiple Records'),
407 'description' => ts('Does this group hold multiple values?'),
408 'where' => 'civicrm_custom_group.is_multiple',
410 'table_name' => 'civicrm_custom_group',
411 'entity' => 'CustomGroup',
412 'bao' => 'CRM_Core_BAO_CustomGroup',
416 'name' => 'min_multiple',
417 'type' => CRM_Utils_Type
::T_INT
,
418 'title' => ts('Minimum Multiple Records'),
419 'description' => ts('minimum number of multiple records (typically 0?)'),
420 'where' => 'civicrm_custom_group.min_multiple',
421 'table_name' => 'civicrm_custom_group',
422 'entity' => 'CustomGroup',
423 'bao' => 'CRM_Core_BAO_CustomGroup',
427 'name' => 'max_multiple',
428 'type' => CRM_Utils_Type
::T_INT
,
429 'title' => ts('Maximum Multiple Records'),
430 'description' => ts('maximum number of multiple records, if 0 - no max'),
431 'where' => 'civicrm_custom_group.max_multiple',
432 'table_name' => 'civicrm_custom_group',
433 'entity' => 'CustomGroup',
434 'bao' => 'CRM_Core_BAO_CustomGroup',
437 'collapse_adv_display' => [
438 'name' => 'collapse_adv_display',
439 'type' => CRM_Utils_Type
::T_BOOLEAN
,
440 'title' => ts('Collapse Group Display'),
441 'description' => ts('Will this group be in collapsed or expanded mode on advanced search display ?'),
442 'where' => 'civicrm_custom_group.collapse_adv_display',
444 'table_name' => 'civicrm_custom_group',
445 'entity' => 'CustomGroup',
446 'bao' => 'CRM_Core_BAO_CustomGroup',
450 'name' => 'created_id',
451 'type' => CRM_Utils_Type
::T_INT
,
452 'title' => ts('Custom Group Created By'),
453 'description' => ts('FK to civicrm_contact, who created this custom group'),
454 'where' => 'civicrm_custom_group.created_id',
455 'table_name' => 'civicrm_custom_group',
456 'entity' => 'CustomGroup',
457 'bao' => 'CRM_Core_BAO_CustomGroup',
459 'FKClassName' => 'CRM_Contact_DAO_Contact',
462 'name' => 'created_date',
463 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
464 'title' => ts('Custom Group Created Date'),
465 'description' => ts('Date and time this custom group was created.'),
466 'where' => 'civicrm_custom_group.created_date',
467 'table_name' => 'civicrm_custom_group',
468 'entity' => 'CustomGroup',
469 'bao' => 'CRM_Core_BAO_CustomGroup',
473 'name' => 'is_reserved',
474 'type' => CRM_Utils_Type
::T_BOOLEAN
,
475 'title' => ts('Reserved Group?'),
476 'description' => ts('Is this a reserved Custom Group?'),
477 'where' => 'civicrm_custom_group.is_reserved',
479 'table_name' => 'civicrm_custom_group',
480 'entity' => 'CustomGroup',
481 'bao' => 'CRM_Core_BAO_CustomGroup',
485 'name' => 'is_public',
486 'type' => CRM_Utils_Type
::T_BOOLEAN
,
487 'title' => ts('Custom Group Is Public?'),
488 'description' => ts('Is this property public?'),
489 'where' => 'civicrm_custom_group.is_public',
491 'table_name' => 'civicrm_custom_group',
492 'entity' => 'CustomGroup',
493 'bao' => 'CRM_Core_BAO_CustomGroup',
497 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
499 return Civi
::$statics[__CLASS__
]['fields'];
503 * Return a mapping from field-name to the corresponding key (as used in fields()).
506 * Array(string $name => string $uniqueName).
508 public static function &fieldKeys() {
509 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
510 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
512 return Civi
::$statics[__CLASS__
]['fieldKeys'];
516 * Returns the names of this table
520 public static function getTableName() {
521 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
525 * Returns if this table needs to be logged
529 public function getLog() {
534 * Returns the list of fields that can be imported
536 * @param bool $prefix
540 public static function &import($prefix = FALSE) {
541 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'custom_group', $prefix, []);
546 * Returns the list of fields that can be exported
548 * @param bool $prefix
552 public static function &export($prefix = FALSE) {
553 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'custom_group', $prefix, []);
558 * Returns the list of indices
560 * @param bool $localize
564 public static function indices($localize = TRUE) {
566 'UI_title_extends' => [
567 'name' => 'UI_title_extends',
572 'localizable' => TRUE,
574 'sig' => 'civicrm_custom_group::1::title::extends',
576 'UI_name_extends' => [
577 'name' => 'UI_name_extends',
582 'localizable' => FALSE,
584 'sig' => 'civicrm_custom_group::1::name::extends',
587 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;