3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2015
31 * Generated from xml/schema/CRM/Core/CustomGroup.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Core_DAO_CustomGroup
extends CRM_Core_DAO
{
38 * static instance to hold the table name
42 static $_tableName = 'civicrm_custom_group';
44 * static instance to hold the field values
48 static $_fields = null;
50 * static instance to hold the keys used in $_fields for each field.
54 static $_fieldKeys = null;
56 * static instance to hold the FK relationships
60 static $_links = null;
62 * static instance to hold the values that can
67 static $_import = null;
69 * static instance to hold the values that can
74 static $_export = null;
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
83 * Unique Custom Group ID
89 * Variable name/programmatic handle for this group.
101 * Type of object this group extends (can add other options later e.g. contact_address, etc.).
107 * FK to civicrm_option_value.id (for option group custom_data_type.)
111 public $extends_entity_column_id;
113 * linking custom group for dynamic object
117 public $extends_entity_column_value;
119 * Visual relationship between this form and its parent.
125 * Will this group be in collapsed or expanded mode on initial display ?
129 public $collapse_display;
131 * Description and/or help text to display before fields in form.
137 * Description and/or help text to display after fields in form.
143 * Controls display order when multiple extended property groups are setup for the same class.
149 * Is this property active?
155 * Name of the table that holds the values for this group.
161 * Does this group hold multiple values?
167 * minimum number of multiple records (typically 0?)
171 public $min_multiple;
173 * maximum number of multiple records, if 0 - no max
177 public $max_multiple;
179 * Will this group be in collapsed or expanded mode on advanced search display ?
183 public $collapse_adv_display;
185 * FK to civicrm_contact, who created this custom group
191 * Date and time this custom group was created.
195 public $created_date;
197 * Is this a reserved Custom Group?
205 * @return civicrm_custom_group
207 function __construct() {
208 $this->__table
= 'civicrm_custom_group';
209 parent
::__construct();
212 * Returns foreign keys and entity references
215 * [CRM_Core_Reference_Interface]
217 static function getReferenceColumns() {
218 if (!self
::$_links) {
219 self
::$_links = static ::createReferenceColumns(__CLASS__
);
220 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
222 return self
::$_links;
225 * Returns all the column names of this table
229 static function &fields() {
230 if (!(self
::$_fields)) {
231 self
::$_fields = array(
234 'type' => CRM_Utils_Type
::T_INT
,
235 'title' => ts('Custom Group ID') ,
236 'description' => 'Unique Custom Group ID',
241 'type' => CRM_Utils_Type
::T_STRING
,
242 'title' => ts('Custom Group Name') ,
243 'description' => 'Variable name/programmatic handle for this group.',
245 'size' => CRM_Utils_Type
::BIG
,
249 'type' => CRM_Utils_Type
::T_STRING
,
250 'title' => ts('Custom Group Title') ,
251 'description' => 'Friendly Name.',
254 'size' => CRM_Utils_Type
::BIG
,
258 'type' => CRM_Utils_Type
::T_STRING
,
259 'title' => ts('Custom Group Extends') ,
260 'description' => 'Type of object this group extends (can add other options later e.g. contact_address, etc.).',
262 'size' => CRM_Utils_Type
::HUGE
,
263 'default' => 'Contact',
265 'extends_entity_column_id' => array(
266 'name' => 'extends_entity_column_id',
267 'type' => CRM_Utils_Type
::T_INT
,
268 'title' => ts('Custom Group Subtype List') ,
269 'description' => 'FK to civicrm_option_value.id (for option group custom_data_type.)',
272 'extends_entity_column_value' => array(
273 'name' => 'extends_entity_column_value',
274 'type' => CRM_Utils_Type
::T_STRING
,
275 'title' => ts('Custom Group Subtype') ,
276 'description' => 'linking custom group for dynamic object',
278 'size' => CRM_Utils_Type
::HUGE
,
282 'type' => CRM_Utils_Type
::T_STRING
,
283 'title' => ts('Custom Group Style') ,
284 'description' => 'Visual relationship between this form and its parent.',
286 'size' => CRM_Utils_Type
::TWELVE
,
290 'pseudoconstant' => array(
291 'callback' => 'CRM_Core_SelectValues::customGroupStyle',
294 'collapse_display' => array(
295 'name' => 'collapse_display',
296 'type' => CRM_Utils_Type
::T_INT
,
297 'title' => ts('Collapse Custom Group?') ,
298 'description' => 'Will this group be in collapsed or expanded mode on initial display ?',
301 'name' => 'help_pre',
302 'type' => CRM_Utils_Type
::T_TEXT
,
303 'title' => ts('Custom Group Pre Text') ,
304 'description' => 'Description and/or help text to display before fields in form.',
308 'type' => 'TextArea',
311 'help_post' => array(
312 'name' => 'help_post',
313 'type' => CRM_Utils_Type
::T_TEXT
,
314 'title' => ts('Custom Group Post Text') ,
315 'description' => 'Description and/or help text to display after fields in form.',
319 'type' => 'TextArea',
324 'type' => CRM_Utils_Type
::T_INT
,
325 'title' => ts('Order') ,
326 'description' => 'Controls display order when multiple extended property groups are setup for the same class.',
330 'is_active' => array(
331 'name' => 'is_active',
332 'type' => CRM_Utils_Type
::T_BOOLEAN
,
333 'title' => ts('Custom Group Is Active?') ,
334 'description' => 'Is this property active?',
336 'table_name' => array(
337 'name' => 'table_name',
338 'type' => CRM_Utils_Type
::T_STRING
,
339 'title' => ts('Table Name') ,
340 'description' => 'Name of the table that holds the values for this group.',
342 'size' => CRM_Utils_Type
::HUGE
,
344 'is_multiple' => array(
345 'name' => 'is_multiple',
346 'type' => CRM_Utils_Type
::T_BOOLEAN
,
347 'title' => ts('Supports Multiple Records') ,
348 'description' => 'Does this group hold multiple values?',
350 'min_multiple' => array(
351 'name' => 'min_multiple',
352 'type' => CRM_Utils_Type
::T_INT
,
353 'title' => ts('Minimum Multiple Records') ,
354 'description' => 'minimum number of multiple records (typically 0?)',
356 'max_multiple' => array(
357 'name' => 'max_multiple',
358 'type' => CRM_Utils_Type
::T_INT
,
359 'title' => ts('Maximum Multiple Records') ,
360 'description' => 'maximum number of multiple records, if 0 - no max',
362 'collapse_adv_display' => array(
363 'name' => 'collapse_adv_display',
364 'type' => CRM_Utils_Type
::T_INT
,
365 'title' => ts('Collapse Group Display') ,
366 'description' => 'Will this group be in collapsed or expanded mode on advanced search display ?',
368 'created_id' => array(
369 'name' => 'created_id',
370 'type' => CRM_Utils_Type
::T_INT
,
371 'title' => ts('Custom Group Created By') ,
372 'description' => 'FK to civicrm_contact, who created this custom group',
373 'FKClassName' => 'CRM_Contact_DAO_Contact',
375 'created_date' => array(
376 'name' => 'created_date',
377 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
378 'title' => ts('Custom Group Created Date') ,
379 'description' => 'Date and time this custom group was created.',
381 'is_reserved' => array(
382 'name' => 'is_reserved',
383 'type' => CRM_Utils_Type
::T_BOOLEAN
,
384 'title' => ts('Reserved Group?') ,
385 'description' => 'Is this a reserved Custom Group?',
389 return self
::$_fields;
392 * Returns an array containing, for each field, the arary key used for that
393 * field in self::$_fields.
397 static function &fieldKeys() {
398 if (!(self
::$_fieldKeys)) {
399 self
::$_fieldKeys = array(
403 'extends' => 'extends',
404 'extends_entity_column_id' => 'extends_entity_column_id',
405 'extends_entity_column_value' => 'extends_entity_column_value',
407 'collapse_display' => 'collapse_display',
408 'help_pre' => 'help_pre',
409 'help_post' => 'help_post',
410 'weight' => 'weight',
411 'is_active' => 'is_active',
412 'table_name' => 'table_name',
413 'is_multiple' => 'is_multiple',
414 'min_multiple' => 'min_multiple',
415 'max_multiple' => 'max_multiple',
416 'collapse_adv_display' => 'collapse_adv_display',
417 'created_id' => 'created_id',
418 'created_date' => 'created_date',
419 'is_reserved' => 'is_reserved',
422 return self
::$_fieldKeys;
425 * Returns the names of this table
429 static function getTableName() {
430 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
433 * Returns if this table needs to be logged
441 * Returns the list of fields that can be imported
443 * @param bool $prefix
447 static function &import($prefix = false) {
448 if (!(self
::$_import)) {
449 self
::$_import = array();
450 $fields = self
::fields();
451 foreach($fields as $name => $field) {
452 if (CRM_Utils_Array
::value('import', $field)) {
454 self
::$_import['custom_group'] = & $fields[$name];
456 self
::$_import[$name] = & $fields[$name];
461 return self
::$_import;
464 * Returns the list of fields that can be exported
466 * @param bool $prefix
470 static function &export($prefix = false) {
471 if (!(self
::$_export)) {
472 self
::$_export = array();
473 $fields = self
::fields();
474 foreach($fields as $name => $field) {
475 if (CRM_Utils_Array
::value('export', $field)) {
477 self
::$_export['custom_group'] = & $fields[$name];
479 self
::$_export[$name] = & $fields[$name];
484 return self
::$_export;