3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
31 * Generated from xml/schema/CRM/Core/CustomGroup.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:38506cd6eee08189ceae6520952a0a48)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_CustomGroup
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_custom_group';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
84 * Unique Custom Group ID
90 * Variable name/programmatic handle for this group.
102 * Type of object this group extends (can add other options later e.g. contact_address, etc.).
108 * FK to civicrm_option_value.id (for option group custom_data_type.)
112 public $extends_entity_column_id;
114 * linking custom group for dynamic object
118 public $extends_entity_column_value;
120 * Visual relationship between this form and its parent.
126 * Will this group be in collapsed or expanded mode on initial display ?
130 public $collapse_display;
132 * Description and/or help text to display before fields in form.
138 * Description and/or help text to display after fields in form.
144 * Controls display order when multiple extended property groups are setup for the same class.
150 * Is this property active?
156 * Name of the table that holds the values for this group.
162 * Does this group hold multiple values?
168 * minimum number of multiple records (typically 0?)
172 public $min_multiple;
174 * maximum number of multiple records, if 0 - no max
178 public $max_multiple;
180 * Will this group be in collapsed or expanded mode on advanced search display ?
184 public $collapse_adv_display;
186 * FK to civicrm_contact, who created this custom group
192 * Date and time this custom group was created.
196 public $created_date;
198 * Is this a reserved Custom Group?
206 * @return civicrm_custom_group
208 function __construct() {
209 $this->__table
= 'civicrm_custom_group';
210 parent
::__construct();
213 * Returns foreign keys and entity references
216 * [CRM_Core_Reference_Interface]
218 static function getReferenceColumns() {
219 if (!self
::$_links) {
220 self
::$_links = static ::createReferenceColumns(__CLASS__
);
221 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'created_id', 'civicrm_contact', 'id');
223 return self
::$_links;
226 * Returns all the column names of this table
230 static function &fields() {
231 if (!(self
::$_fields)) {
232 self
::$_fields = array(
235 'type' => CRM_Utils_Type
::T_INT
,
236 'title' => ts('Custom Group ID') ,
237 'description' => 'Unique Custom Group ID',
242 'type' => CRM_Utils_Type
::T_STRING
,
243 'title' => ts('Custom Group Name') ,
244 'description' => 'Variable name/programmatic handle for this group.',
246 'size' => CRM_Utils_Type
::BIG
,
250 'type' => CRM_Utils_Type
::T_STRING
,
251 'title' => ts('Custom Group Title') ,
252 'description' => 'Friendly Name.',
255 'size' => CRM_Utils_Type
::BIG
,
259 'type' => CRM_Utils_Type
::T_STRING
,
260 'title' => ts('Custom Group Extends') ,
261 'description' => 'Type of object this group extends (can add other options later e.g. contact_address, etc.).',
263 'size' => CRM_Utils_Type
::HUGE
,
264 'default' => 'Contact',
266 'extends_entity_column_id' => array(
267 'name' => 'extends_entity_column_id',
268 'type' => CRM_Utils_Type
::T_INT
,
269 'title' => ts('Custom Group Subtype List') ,
270 'description' => 'FK to civicrm_option_value.id (for option group custom_data_type.)',
273 'extends_entity_column_value' => array(
274 'name' => 'extends_entity_column_value',
275 'type' => CRM_Utils_Type
::T_STRING
,
276 'title' => ts('Custom Group Subtype') ,
277 'description' => 'linking custom group for dynamic object',
279 'size' => CRM_Utils_Type
::HUGE
,
283 'type' => CRM_Utils_Type
::T_STRING
,
284 'title' => ts('Custom Group Style') ,
285 'description' => 'Visual relationship between this form and its parent.',
287 'size' => CRM_Utils_Type
::TWELVE
,
291 'pseudoconstant' => array(
292 'callback' => 'CRM_Core_SelectValues::customGroupStyle',
295 'collapse_display' => array(
296 'name' => 'collapse_display',
297 'type' => CRM_Utils_Type
::T_INT
,
298 'title' => ts('Collapse Custom Group?') ,
299 'description' => 'Will this group be in collapsed or expanded mode on initial display ?',
302 'name' => 'help_pre',
303 'type' => CRM_Utils_Type
::T_TEXT
,
304 'title' => ts('Custom Group Pre Text') ,
305 'description' => 'Description and/or help text to display before fields in form.',
309 'type' => 'TextArea',
312 'help_post' => array(
313 'name' => 'help_post',
314 'type' => CRM_Utils_Type
::T_TEXT
,
315 'title' => ts('Custom Group Post Text') ,
316 'description' => 'Description and/or help text to display after fields in form.',
320 'type' => 'TextArea',
325 'type' => CRM_Utils_Type
::T_INT
,
326 'title' => ts('Order') ,
327 'description' => 'Controls display order when multiple extended property groups are setup for the same class.',
331 'is_active' => array(
332 'name' => 'is_active',
333 'type' => CRM_Utils_Type
::T_BOOLEAN
,
334 'title' => ts('Custom Group Is Active?') ,
335 'description' => 'Is this property active?',
337 'table_name' => array(
338 'name' => 'table_name',
339 'type' => CRM_Utils_Type
::T_STRING
,
340 'title' => ts('Table Name') ,
341 'description' => 'Name of the table that holds the values for this group.',
343 'size' => CRM_Utils_Type
::HUGE
,
345 'is_multiple' => array(
346 'name' => 'is_multiple',
347 'type' => CRM_Utils_Type
::T_BOOLEAN
,
348 'title' => ts('Supports Multiple Records') ,
349 'description' => 'Does this group hold multiple values?',
351 'min_multiple' => array(
352 'name' => 'min_multiple',
353 'type' => CRM_Utils_Type
::T_INT
,
354 'title' => ts('Minimum Multiple Records') ,
355 'description' => 'minimum number of multiple records (typically 0?)',
357 'max_multiple' => array(
358 'name' => 'max_multiple',
359 'type' => CRM_Utils_Type
::T_INT
,
360 'title' => ts('Maximum Multiple Records') ,
361 'description' => 'maximum number of multiple records, if 0 - no max',
363 'collapse_adv_display' => array(
364 'name' => 'collapse_adv_display',
365 'type' => CRM_Utils_Type
::T_INT
,
366 'title' => ts('Collapse Group Display') ,
367 'description' => 'Will this group be in collapsed or expanded mode on advanced search display ?',
369 'created_id' => array(
370 'name' => 'created_id',
371 'type' => CRM_Utils_Type
::T_INT
,
372 'title' => ts('Custom Group Created By') ,
373 'description' => 'FK to civicrm_contact, who created this custom group',
374 'FKClassName' => 'CRM_Contact_DAO_Contact',
376 'created_date' => array(
377 'name' => 'created_date',
378 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
379 'title' => ts('Custom Group Created Date') ,
380 'description' => 'Date and time this custom group was created.',
382 'is_reserved' => array(
383 'name' => 'is_reserved',
384 'type' => CRM_Utils_Type
::T_BOOLEAN
,
385 'title' => ts('Reserved Group?') ,
386 'description' => 'Is this a reserved Custom Group?',
390 return self
::$_fields;
393 * Returns an array containing, for each field, the arary key used for that
394 * field in self::$_fields.
398 static function &fieldKeys() {
399 if (!(self
::$_fieldKeys)) {
400 self
::$_fieldKeys = array(
404 'extends' => 'extends',
405 'extends_entity_column_id' => 'extends_entity_column_id',
406 'extends_entity_column_value' => 'extends_entity_column_value',
408 'collapse_display' => 'collapse_display',
409 'help_pre' => 'help_pre',
410 'help_post' => 'help_post',
411 'weight' => 'weight',
412 'is_active' => 'is_active',
413 'table_name' => 'table_name',
414 'is_multiple' => 'is_multiple',
415 'min_multiple' => 'min_multiple',
416 'max_multiple' => 'max_multiple',
417 'collapse_adv_display' => 'collapse_adv_display',
418 'created_id' => 'created_id',
419 'created_date' => 'created_date',
420 'is_reserved' => 'is_reserved',
423 return self
::$_fieldKeys;
426 * Returns the names of this table
430 static function getTableName() {
431 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
434 * Returns if this table needs to be logged
442 * Returns the list of fields that can be imported
444 * @param bool $prefix
448 static function &import($prefix = false) {
449 if (!(self
::$_import)) {
450 self
::$_import = array();
451 $fields = self
::fields();
452 foreach($fields as $name => $field) {
453 if (CRM_Utils_Array
::value('import', $field)) {
455 self
::$_import['custom_group'] = & $fields[$name];
457 self
::$_import[$name] = & $fields[$name];
462 return self
::$_import;
465 * Returns the list of fields that can be exported
467 * @param bool $prefix
471 static function &export($prefix = false) {
472 if (!(self
::$_export)) {
473 self
::$_export = array();
474 $fields = self
::fields();
475 foreach($fields as $name => $field) {
476 if (CRM_Utils_Array
::value('export', $field)) {
478 self
::$_export['custom_group'] = & $fields[$name];
480 self
::$_export[$name] = & $fields[$name];
485 return self
::$_export;