5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/CustomGroup.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:288ec5d75e51339f23a2057dc1a383d2)
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 foreign keys and entity references.
190 * [CRM_Core_Reference_Interface]
192 public static function getReferenceColumns() {
193 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
194 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
195 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'created_id', 'civicrm_contact', 'id');
196 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
198 return Civi
::$statics[__CLASS__
]['links'];
202 * Returns all the column names of this table
206 public static function &fields() {
207 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
208 Civi
::$statics[__CLASS__
]['fields'] = [
211 'type' => CRM_Utils_Type
::T_INT
,
212 'title' => ts('Custom Group ID'),
213 'description' => ts('Unique Custom Group ID'),
215 'where' => 'civicrm_custom_group.id',
216 'table_name' => 'civicrm_custom_group',
217 'entity' => 'CustomGroup',
218 'bao' => 'CRM_Core_BAO_CustomGroup',
223 'type' => CRM_Utils_Type
::T_STRING
,
224 'title' => ts('Custom Group Name'),
225 'description' => ts('Variable name/programmatic handle for this group.'),
227 'size' => CRM_Utils_Type
::BIG
,
228 'where' => 'civicrm_custom_group.name',
229 'table_name' => 'civicrm_custom_group',
230 'entity' => 'CustomGroup',
231 'bao' => 'CRM_Core_BAO_CustomGroup',
236 'type' => CRM_Utils_Type
::T_STRING
,
237 'title' => ts('Custom Group Title'),
238 'description' => ts('Friendly Name.'),
241 'size' => CRM_Utils_Type
::BIG
,
242 'where' => 'civicrm_custom_group.title',
243 'table_name' => 'civicrm_custom_group',
244 'entity' => 'CustomGroup',
245 'bao' => 'CRM_Core_BAO_CustomGroup',
250 'type' => CRM_Utils_Type
::T_STRING
,
251 'title' => ts('Custom Group Extends'),
252 'description' => ts('Type of object this group extends (can add other options later e.g. contact_address, etc.).'),
254 'size' => CRM_Utils_Type
::HUGE
,
255 'where' => 'civicrm_custom_group.extends',
256 'default' => 'Contact',
257 'table_name' => 'civicrm_custom_group',
258 'entity' => 'CustomGroup',
259 'bao' => 'CRM_Core_BAO_CustomGroup',
262 'extends_entity_column_id' => [
263 'name' => 'extends_entity_column_id',
264 'type' => CRM_Utils_Type
::T_INT
,
265 'title' => ts('Custom Group Subtype List'),
266 'description' => ts('FK to civicrm_option_value.id (for option group custom_data_type.)'),
267 'where' => 'civicrm_custom_group.extends_entity_column_id',
269 'table_name' => 'civicrm_custom_group',
270 'entity' => 'CustomGroup',
271 'bao' => 'CRM_Core_BAO_CustomGroup',
276 'pseudoconstant' => [
277 'optionGroupName' => 'custom_data_type',
278 'optionEditPath' => 'civicrm/admin/options/custom_data_type',
281 'extends_entity_column_value' => [
282 'name' => 'extends_entity_column_value',
283 'type' => CRM_Utils_Type
::T_STRING
,
284 'title' => ts('Custom Group Subtype'),
285 'description' => ts('linking custom group for dynamic object'),
287 'size' => CRM_Utils_Type
::HUGE
,
288 'where' => 'civicrm_custom_group.extends_entity_column_value',
289 'table_name' => 'civicrm_custom_group',
290 'entity' => 'CustomGroup',
291 'bao' => 'CRM_Core_BAO_CustomGroup',
293 'serialize' => self
::SERIALIZE_SEPARATOR_BOOKEND
,
297 'type' => CRM_Utils_Type
::T_STRING
,
298 'title' => ts('Custom Group Style'),
299 'description' => ts('Visual relationship between this form and its parent.'),
301 'size' => CRM_Utils_Type
::TWELVE
,
302 'where' => 'civicrm_custom_group.style',
303 'table_name' => 'civicrm_custom_group',
304 'entity' => 'CustomGroup',
305 'bao' => 'CRM_Core_BAO_CustomGroup',
310 'pseudoconstant' => [
311 'callback' => 'CRM_Core_SelectValues::customGroupStyle',
314 'collapse_display' => [
315 'name' => 'collapse_display',
316 'type' => CRM_Utils_Type
::T_INT
,
317 'title' => ts('Collapse Custom Group?'),
318 'description' => ts('Will this group be in collapsed or expanded mode on initial display ?'),
319 'where' => 'civicrm_custom_group.collapse_display',
321 'table_name' => 'civicrm_custom_group',
322 'entity' => 'CustomGroup',
323 'bao' => 'CRM_Core_BAO_CustomGroup',
327 'name' => 'help_pre',
328 'type' => CRM_Utils_Type
::T_TEXT
,
329 'title' => ts('Custom Group Pre Text'),
330 'description' => ts('Description and/or help text to display before fields in form.'),
333 'where' => 'civicrm_custom_group.help_pre',
334 'table_name' => 'civicrm_custom_group',
335 'entity' => 'CustomGroup',
336 'bao' => 'CRM_Core_BAO_CustomGroup',
339 'type' => 'TextArea',
343 'name' => 'help_post',
344 'type' => CRM_Utils_Type
::T_TEXT
,
345 'title' => ts('Custom Group Post Text'),
346 'description' => ts('Description and/or help text to display after fields in form.'),
349 'where' => 'civicrm_custom_group.help_post',
350 'table_name' => 'civicrm_custom_group',
351 'entity' => 'CustomGroup',
352 'bao' => 'CRM_Core_BAO_CustomGroup',
355 'type' => 'TextArea',
360 'type' => CRM_Utils_Type
::T_INT
,
361 'title' => ts('Order'),
362 'description' => ts('Controls display order when multiple extended property groups are setup for the same class.'),
364 'where' => 'civicrm_custom_group.weight',
366 'table_name' => 'civicrm_custom_group',
367 'entity' => 'CustomGroup',
368 'bao' => 'CRM_Core_BAO_CustomGroup',
372 'name' => 'is_active',
373 'type' => CRM_Utils_Type
::T_BOOLEAN
,
374 'title' => ts('Custom Group Is Active?'),
375 'description' => ts('Is this property active?'),
376 'where' => 'civicrm_custom_group.is_active',
378 'table_name' => 'civicrm_custom_group',
379 'entity' => 'CustomGroup',
380 'bao' => 'CRM_Core_BAO_CustomGroup',
384 'name' => 'table_name',
385 'type' => CRM_Utils_Type
::T_STRING
,
386 'title' => ts('Table Name'),
387 'description' => ts('Name of the table that holds the values for this group.'),
389 'size' => CRM_Utils_Type
::HUGE
,
390 'where' => 'civicrm_custom_group.table_name',
391 'table_name' => 'civicrm_custom_group',
392 'entity' => 'CustomGroup',
393 'bao' => 'CRM_Core_BAO_CustomGroup',
397 'name' => 'is_multiple',
398 'type' => CRM_Utils_Type
::T_BOOLEAN
,
399 'title' => ts('Supports Multiple Records'),
400 'description' => ts('Does this group hold multiple values?'),
401 'where' => 'civicrm_custom_group.is_multiple',
403 'table_name' => 'civicrm_custom_group',
404 'entity' => 'CustomGroup',
405 'bao' => 'CRM_Core_BAO_CustomGroup',
409 'name' => 'min_multiple',
410 'type' => CRM_Utils_Type
::T_INT
,
411 'title' => ts('Minimum Multiple Records'),
412 'description' => ts('minimum number of multiple records (typically 0?)'),
413 'where' => 'civicrm_custom_group.min_multiple',
414 'table_name' => 'civicrm_custom_group',
415 'entity' => 'CustomGroup',
416 'bao' => 'CRM_Core_BAO_CustomGroup',
420 'name' => 'max_multiple',
421 'type' => CRM_Utils_Type
::T_INT
,
422 'title' => ts('Maximum Multiple Records'),
423 'description' => ts('maximum number of multiple records, if 0 - no max'),
424 'where' => 'civicrm_custom_group.max_multiple',
425 'table_name' => 'civicrm_custom_group',
426 'entity' => 'CustomGroup',
427 'bao' => 'CRM_Core_BAO_CustomGroup',
430 'collapse_adv_display' => [
431 'name' => 'collapse_adv_display',
432 'type' => CRM_Utils_Type
::T_INT
,
433 'title' => ts('Collapse Group Display'),
434 'description' => ts('Will this group be in collapsed or expanded mode on advanced search display ?'),
435 'where' => 'civicrm_custom_group.collapse_adv_display',
437 'table_name' => 'civicrm_custom_group',
438 'entity' => 'CustomGroup',
439 'bao' => 'CRM_Core_BAO_CustomGroup',
443 'name' => 'created_id',
444 'type' => CRM_Utils_Type
::T_INT
,
445 'title' => ts('Custom Group Created By'),
446 'description' => ts('FK to civicrm_contact, who created this custom group'),
447 'where' => 'civicrm_custom_group.created_id',
448 'table_name' => 'civicrm_custom_group',
449 'entity' => 'CustomGroup',
450 'bao' => 'CRM_Core_BAO_CustomGroup',
452 'FKClassName' => 'CRM_Contact_DAO_Contact',
455 'name' => 'created_date',
456 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
457 'title' => ts('Custom Group Created Date'),
458 'description' => ts('Date and time this custom group was created.'),
459 'where' => 'civicrm_custom_group.created_date',
460 'table_name' => 'civicrm_custom_group',
461 'entity' => 'CustomGroup',
462 'bao' => 'CRM_Core_BAO_CustomGroup',
466 'name' => 'is_reserved',
467 'type' => CRM_Utils_Type
::T_BOOLEAN
,
468 'title' => ts('Reserved Group?'),
469 'description' => ts('Is this a reserved Custom Group?'),
470 'where' => 'civicrm_custom_group.is_reserved',
472 'table_name' => 'civicrm_custom_group',
473 'entity' => 'CustomGroup',
474 'bao' => 'CRM_Core_BAO_CustomGroup',
478 'name' => 'is_public',
479 'type' => CRM_Utils_Type
::T_BOOLEAN
,
480 'title' => ts('Custom Group Is Public?'),
481 'description' => ts('Is this property public?'),
482 'where' => 'civicrm_custom_group.is_public',
484 'table_name' => 'civicrm_custom_group',
485 'entity' => 'CustomGroup',
486 'bao' => 'CRM_Core_BAO_CustomGroup',
490 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
492 return Civi
::$statics[__CLASS__
]['fields'];
496 * Return a mapping from field-name to the corresponding key (as used in fields()).
499 * Array(string $name => string $uniqueName).
501 public static function &fieldKeys() {
502 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
503 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
505 return Civi
::$statics[__CLASS__
]['fieldKeys'];
509 * Returns the names of this table
513 public static function getTableName() {
514 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
518 * Returns if this table needs to be logged
522 public function getLog() {
527 * Returns the list of fields that can be imported
529 * @param bool $prefix
533 public static function &import($prefix = FALSE) {
534 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'custom_group', $prefix, []);
539 * Returns the list of fields that can be exported
541 * @param bool $prefix
545 public static function &export($prefix = FALSE) {
546 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'custom_group', $prefix, []);
551 * Returns the list of indices
553 * @param bool $localize
557 public static function indices($localize = TRUE) {
559 'UI_title_extends' => [
560 'name' => 'UI_title_extends',
565 'localizable' => TRUE,
567 'sig' => 'civicrm_custom_group::1::title::extends',
569 'UI_name_extends' => [
570 'name' => 'UI_name_extends',
575 'localizable' => FALSE,
577 'sig' => 'civicrm_custom_group::1::name::extends',
580 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;