5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Core/CustomGroup.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:6b88842459aadee0598c08bd4d7518f2)
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 static $_tableName = 'civicrm_custom_group';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 'table_name' => 'civicrm_custom_group',
216 'entity' => 'CustomGroup',
217 'bao' => 'CRM_Core_BAO_CustomGroup',
222 'type' => CRM_Utils_Type
::T_STRING
,
223 'title' => ts('Custom Group Name'),
224 'description' => ts('Variable name/programmatic handle for this group.'),
226 'size' => CRM_Utils_Type
::BIG
,
227 'table_name' => 'civicrm_custom_group',
228 'entity' => 'CustomGroup',
229 'bao' => 'CRM_Core_BAO_CustomGroup',
234 'type' => CRM_Utils_Type
::T_STRING
,
235 'title' => ts('Custom Group Title'),
236 'description' => ts('Friendly Name.'),
239 'size' => CRM_Utils_Type
::BIG
,
240 'table_name' => 'civicrm_custom_group',
241 'entity' => 'CustomGroup',
242 'bao' => 'CRM_Core_BAO_CustomGroup',
247 'type' => CRM_Utils_Type
::T_STRING
,
248 'title' => ts('Custom Group Extends'),
249 'description' => ts('Type of object this group extends (can add other options later e.g. contact_address, etc.).'),
251 'size' => CRM_Utils_Type
::HUGE
,
252 'default' => 'Contact',
253 'table_name' => 'civicrm_custom_group',
254 'entity' => 'CustomGroup',
255 'bao' => 'CRM_Core_BAO_CustomGroup',
258 'extends_entity_column_id' => [
259 'name' => 'extends_entity_column_id',
260 'type' => CRM_Utils_Type
::T_INT
,
261 'title' => ts('Custom Group Subtype List'),
262 'description' => ts('FK to civicrm_option_value.id (for option group custom_data_type.)'),
264 'table_name' => 'civicrm_custom_group',
265 'entity' => 'CustomGroup',
266 'bao' => 'CRM_Core_BAO_CustomGroup',
271 'pseudoconstant' => [
272 'optionGroupName' => 'custom_data_type',
273 'optionEditPath' => 'civicrm/admin/options/custom_data_type',
276 'extends_entity_column_value' => [
277 'name' => 'extends_entity_column_value',
278 'type' => CRM_Utils_Type
::T_STRING
,
279 'title' => ts('Custom Group Subtype'),
280 'description' => ts('linking custom group for dynamic object'),
282 'size' => CRM_Utils_Type
::HUGE
,
283 'table_name' => 'civicrm_custom_group',
284 'entity' => 'CustomGroup',
285 'bao' => 'CRM_Core_BAO_CustomGroup',
287 'serialize' => self
::SERIALIZE_SEPARATOR_BOOKEND
,
291 'type' => CRM_Utils_Type
::T_STRING
,
292 'title' => ts('Custom Group Style'),
293 'description' => ts('Visual relationship between this form and its parent.'),
295 'size' => CRM_Utils_Type
::TWELVE
,
296 'table_name' => 'civicrm_custom_group',
297 'entity' => 'CustomGroup',
298 'bao' => 'CRM_Core_BAO_CustomGroup',
303 'pseudoconstant' => [
304 'callback' => 'CRM_Core_SelectValues::customGroupStyle',
307 'collapse_display' => [
308 'name' => 'collapse_display',
309 'type' => CRM_Utils_Type
::T_INT
,
310 'title' => ts('Collapse Custom Group?'),
311 'description' => ts('Will this group be in collapsed or expanded mode on initial display ?'),
313 'table_name' => 'civicrm_custom_group',
314 'entity' => 'CustomGroup',
315 'bao' => 'CRM_Core_BAO_CustomGroup',
319 'name' => 'help_pre',
320 'type' => CRM_Utils_Type
::T_TEXT
,
321 'title' => ts('Custom Group Pre Text'),
322 'description' => ts('Description and/or help text to display before fields in form.'),
325 'table_name' => 'civicrm_custom_group',
326 'entity' => 'CustomGroup',
327 'bao' => 'CRM_Core_BAO_CustomGroup',
330 'type' => 'TextArea',
334 'name' => 'help_post',
335 'type' => CRM_Utils_Type
::T_TEXT
,
336 'title' => ts('Custom Group Post Text'),
337 'description' => ts('Description and/or help text to display after fields in form.'),
340 'table_name' => 'civicrm_custom_group',
341 'entity' => 'CustomGroup',
342 'bao' => 'CRM_Core_BAO_CustomGroup',
345 'type' => 'TextArea',
350 'type' => CRM_Utils_Type
::T_INT
,
351 'title' => ts('Order'),
352 'description' => ts('Controls display order when multiple extended property groups are setup for the same class.'),
355 'table_name' => 'civicrm_custom_group',
356 'entity' => 'CustomGroup',
357 'bao' => 'CRM_Core_BAO_CustomGroup',
361 'name' => 'is_active',
362 'type' => CRM_Utils_Type
::T_BOOLEAN
,
363 'title' => ts('Custom Group Is Active?'),
364 'description' => ts('Is this property active?'),
366 'table_name' => 'civicrm_custom_group',
367 'entity' => 'CustomGroup',
368 'bao' => 'CRM_Core_BAO_CustomGroup',
372 'name' => 'table_name',
373 'type' => CRM_Utils_Type
::T_STRING
,
374 'title' => ts('Table Name'),
375 'description' => ts('Name of the table that holds the values for this group.'),
377 'size' => CRM_Utils_Type
::HUGE
,
378 'table_name' => 'civicrm_custom_group',
379 'entity' => 'CustomGroup',
380 'bao' => 'CRM_Core_BAO_CustomGroup',
384 'name' => 'is_multiple',
385 'type' => CRM_Utils_Type
::T_BOOLEAN
,
386 'title' => ts('Supports Multiple Records'),
387 'description' => ts('Does this group hold multiple values?'),
389 'table_name' => 'civicrm_custom_group',
390 'entity' => 'CustomGroup',
391 'bao' => 'CRM_Core_BAO_CustomGroup',
395 'name' => 'min_multiple',
396 'type' => CRM_Utils_Type
::T_INT
,
397 'title' => ts('Minimum Multiple Records'),
398 'description' => ts('minimum number of multiple records (typically 0?)'),
399 'table_name' => 'civicrm_custom_group',
400 'entity' => 'CustomGroup',
401 'bao' => 'CRM_Core_BAO_CustomGroup',
405 'name' => 'max_multiple',
406 'type' => CRM_Utils_Type
::T_INT
,
407 'title' => ts('Maximum Multiple Records'),
408 'description' => ts('maximum number of multiple records, if 0 - no max'),
409 'table_name' => 'civicrm_custom_group',
410 'entity' => 'CustomGroup',
411 'bao' => 'CRM_Core_BAO_CustomGroup',
414 'collapse_adv_display' => [
415 'name' => 'collapse_adv_display',
416 'type' => CRM_Utils_Type
::T_INT
,
417 'title' => ts('Collapse Group Display'),
418 'description' => ts('Will this group be in collapsed or expanded mode on advanced search display ?'),
420 'table_name' => 'civicrm_custom_group',
421 'entity' => 'CustomGroup',
422 'bao' => 'CRM_Core_BAO_CustomGroup',
426 'name' => 'created_id',
427 'type' => CRM_Utils_Type
::T_INT
,
428 'title' => ts('Custom Group Created By'),
429 'description' => ts('FK to civicrm_contact, who created this custom group'),
430 'table_name' => 'civicrm_custom_group',
431 'entity' => 'CustomGroup',
432 'bao' => 'CRM_Core_BAO_CustomGroup',
434 'FKClassName' => 'CRM_Contact_DAO_Contact',
437 'name' => 'created_date',
438 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
439 'title' => ts('Custom Group Created Date'),
440 'description' => ts('Date and time this custom group was created.'),
441 'table_name' => 'civicrm_custom_group',
442 'entity' => 'CustomGroup',
443 'bao' => 'CRM_Core_BAO_CustomGroup',
447 'name' => 'is_reserved',
448 'type' => CRM_Utils_Type
::T_BOOLEAN
,
449 'title' => ts('Reserved Group?'),
450 'description' => ts('Is this a reserved Custom Group?'),
452 'table_name' => 'civicrm_custom_group',
453 'entity' => 'CustomGroup',
454 'bao' => 'CRM_Core_BAO_CustomGroup',
458 'name' => 'is_public',
459 'type' => CRM_Utils_Type
::T_BOOLEAN
,
460 'title' => ts('Custom Group Is Public?'),
461 'description' => ts('Is this property public?'),
463 'table_name' => 'civicrm_custom_group',
464 'entity' => 'CustomGroup',
465 'bao' => 'CRM_Core_BAO_CustomGroup',
469 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
471 return Civi
::$statics[__CLASS__
]['fields'];
475 * Return a mapping from field-name to the corresponding key (as used in fields()).
478 * Array(string $name => string $uniqueName).
480 public static function &fieldKeys() {
481 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
482 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
484 return Civi
::$statics[__CLASS__
]['fieldKeys'];
488 * Returns the names of this table
492 public static function getTableName() {
493 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
497 * Returns if this table needs to be logged
501 public function getLog() {
506 * Returns the list of fields that can be imported
508 * @param bool $prefix
512 public static function &import($prefix = FALSE) {
513 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'custom_group', $prefix, []);
518 * Returns the list of fields that can be exported
520 * @param bool $prefix
524 public static function &export($prefix = FALSE) {
525 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'custom_group', $prefix, []);
530 * Returns the list of indices
532 * @param bool $localize
536 public static function indices($localize = TRUE) {
538 'UI_title_extends' => [
539 'name' => 'UI_title_extends',
544 'localizable' => TRUE,
546 'sig' => 'civicrm_custom_group::1::title::extends',
548 'UI_name_extends' => [
549 'name' => 'UI_name_extends',
554 'localizable' => FALSE,
556 'sig' => 'civicrm_custom_group::1::name::extends',
559 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;