commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-old / civicrm / CRM / Core / DAO / CustomGroup.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2015
30 *
31 * Generated from xml/schema/CRM/Core/CustomGroup.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 */
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Core_DAO_CustomGroup extends CRM_Core_DAO {
37 /**
38 * static instance to hold the table name
39 *
40 * @var string
41 */
42 static $_tableName = 'civicrm_custom_group';
43 /**
44 * static instance to hold the field values
45 *
46 * @var array
47 */
48 static $_fields = null;
49 /**
50 * static instance to hold the keys used in $_fields for each field.
51 *
52 * @var array
53 */
54 static $_fieldKeys = null;
55 /**
56 * static instance to hold the FK relationships
57 *
58 * @var string
59 */
60 static $_links = null;
61 /**
62 * static instance to hold the values that can
63 * be imported
64 *
65 * @var array
66 */
67 static $_import = null;
68 /**
69 * static instance to hold the values that can
70 * be exported
71 *
72 * @var array
73 */
74 static $_export = null;
75 /**
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
78 *
79 * @var boolean
80 */
81 static $_log = true;
82 /**
83 * Unique Custom Group ID
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * Variable name/programmatic handle for this group.
90 *
91 * @var string
92 */
93 public $name;
94 /**
95 * Friendly Name.
96 *
97 * @var string
98 */
99 public $title;
100 /**
101 * Type of object this group extends (can add other options later e.g. contact_address, etc.).
102 *
103 * @var string
104 */
105 public $extends;
106 /**
107 * FK to civicrm_option_value.id (for option group custom_data_type.)
108 *
109 * @var int unsigned
110 */
111 public $extends_entity_column_id;
112 /**
113 * linking custom group for dynamic object
114 *
115 * @var string
116 */
117 public $extends_entity_column_value;
118 /**
119 * Visual relationship between this form and its parent.
120 *
121 * @var string
122 */
123 public $style;
124 /**
125 * Will this group be in collapsed or expanded mode on initial display ?
126 *
127 * @var int unsigned
128 */
129 public $collapse_display;
130 /**
131 * Description and/or help text to display before fields in form.
132 *
133 * @var text
134 */
135 public $help_pre;
136 /**
137 * Description and/or help text to display after fields in form.
138 *
139 * @var text
140 */
141 public $help_post;
142 /**
143 * Controls display order when multiple extended property groups are setup for the same class.
144 *
145 * @var int
146 */
147 public $weight;
148 /**
149 * Is this property active?
150 *
151 * @var boolean
152 */
153 public $is_active;
154 /**
155 * Name of the table that holds the values for this group.
156 *
157 * @var string
158 */
159 public $table_name;
160 /**
161 * Does this group hold multiple values?
162 *
163 * @var boolean
164 */
165 public $is_multiple;
166 /**
167 * minimum number of multiple records (typically 0?)
168 *
169 * @var int unsigned
170 */
171 public $min_multiple;
172 /**
173 * maximum number of multiple records, if 0 - no max
174 *
175 * @var int unsigned
176 */
177 public $max_multiple;
178 /**
179 * Will this group be in collapsed or expanded mode on advanced search display ?
180 *
181 * @var int unsigned
182 */
183 public $collapse_adv_display;
184 /**
185 * FK to civicrm_contact, who created this custom group
186 *
187 * @var int unsigned
188 */
189 public $created_id;
190 /**
191 * Date and time this custom group was created.
192 *
193 * @var datetime
194 */
195 public $created_date;
196 /**
197 * Is this a reserved Custom Group?
198 *
199 * @var boolean
200 */
201 public $is_reserved;
202 /**
203 * class constructor
204 *
205 * @return civicrm_custom_group
206 */
207 function __construct() {
208 $this->__table = 'civicrm_custom_group';
209 parent::__construct();
210 }
211 /**
212 * Returns foreign keys and entity references
213 *
214 * @return array
215 * [CRM_Core_Reference_Interface]
216 */
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');
221 }
222 return self::$_links;
223 }
224 /**
225 * Returns all the column names of this table
226 *
227 * @return array
228 */
229 static function &fields() {
230 if (!(self::$_fields)) {
231 self::$_fields = array(
232 'id' => array(
233 'name' => 'id',
234 'type' => CRM_Utils_Type::T_INT,
235 'title' => ts('Custom Group ID') ,
236 'description' => 'Unique Custom Group ID',
237 'required' => true,
238 ) ,
239 'name' => array(
240 'name' => 'name',
241 'type' => CRM_Utils_Type::T_STRING,
242 'title' => ts('Custom Group Name') ,
243 'description' => 'Variable name/programmatic handle for this group.',
244 'maxlength' => 64,
245 'size' => CRM_Utils_Type::BIG,
246 ) ,
247 'title' => array(
248 'name' => 'title',
249 'type' => CRM_Utils_Type::T_STRING,
250 'title' => ts('Custom Group Title') ,
251 'description' => 'Friendly Name.',
252 'required' => true,
253 'maxlength' => 64,
254 'size' => CRM_Utils_Type::BIG,
255 ) ,
256 'extends' => array(
257 'name' => 'extends',
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.).',
261 'maxlength' => 255,
262 'size' => CRM_Utils_Type::HUGE,
263 'default' => 'Contact',
264 ) ,
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.)',
270 'default' => 'NULL',
271 ) ,
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',
277 'maxlength' => 255,
278 'size' => CRM_Utils_Type::HUGE,
279 ) ,
280 'style' => array(
281 'name' => 'style',
282 'type' => CRM_Utils_Type::T_STRING,
283 'title' => ts('Custom Group Style') ,
284 'description' => 'Visual relationship between this form and its parent.',
285 'maxlength' => 15,
286 'size' => CRM_Utils_Type::TWELVE,
287 'html' => array(
288 'type' => 'Select',
289 ) ,
290 'pseudoconstant' => array(
291 'callback' => 'CRM_Core_SelectValues::customGroupStyle',
292 )
293 ) ,
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 ?',
299 ) ,
300 'help_pre' => array(
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.',
305 'rows' => 4,
306 'cols' => 80,
307 'html' => array(
308 'type' => 'TextArea',
309 ) ,
310 ) ,
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.',
316 'rows' => 4,
317 'cols' => 80,
318 'html' => array(
319 'type' => 'TextArea',
320 ) ,
321 ) ,
322 'weight' => array(
323 'name' => 'weight',
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.',
327 'required' => true,
328 'default' => '1',
329 ) ,
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?',
335 ) ,
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.',
341 'maxlength' => 255,
342 'size' => CRM_Utils_Type::HUGE,
343 ) ,
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?',
349 ) ,
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?)',
355 ) ,
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',
361 ) ,
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 ?',
367 ) ,
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',
374 ) ,
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.',
380 ) ,
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?',
386 ) ,
387 );
388 }
389 return self::$_fields;
390 }
391 /**
392 * Returns an array containing, for each field, the arary key used for that
393 * field in self::$_fields.
394 *
395 * @return array
396 */
397 static function &fieldKeys() {
398 if (!(self::$_fieldKeys)) {
399 self::$_fieldKeys = array(
400 'id' => 'id',
401 'name' => 'name',
402 'title' => 'title',
403 'extends' => 'extends',
404 'extends_entity_column_id' => 'extends_entity_column_id',
405 'extends_entity_column_value' => 'extends_entity_column_value',
406 'style' => 'style',
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',
420 );
421 }
422 return self::$_fieldKeys;
423 }
424 /**
425 * Returns the names of this table
426 *
427 * @return string
428 */
429 static function getTableName() {
430 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
431 }
432 /**
433 * Returns if this table needs to be logged
434 *
435 * @return boolean
436 */
437 function getLog() {
438 return self::$_log;
439 }
440 /**
441 * Returns the list of fields that can be imported
442 *
443 * @param bool $prefix
444 *
445 * @return array
446 */
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)) {
453 if ($prefix) {
454 self::$_import['custom_group'] = & $fields[$name];
455 } else {
456 self::$_import[$name] = & $fields[$name];
457 }
458 }
459 }
460 }
461 return self::$_import;
462 }
463 /**
464 * Returns the list of fields that can be exported
465 *
466 * @param bool $prefix
467 *
468 * @return array
469 */
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)) {
476 if ($prefix) {
477 self::$_export['custom_group'] = & $fields[$name];
478 } else {
479 self::$_export[$name] = & $fields[$name];
480 }
481 }
482 }
483 }
484 return self::$_export;
485 }
486 }