Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
6b83d5bd | 5 | * @copyright CiviCRM LLC (c) 2004-2019 |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Core/CustomGroup.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
e6ca0a57 | 9 | * (GenCodeChecksum:288ec5d75e51339f23a2057dc1a383d2) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the CustomGroup entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Core_DAO_CustomGroup extends CRM_Core_DAO { |
c3fc2621 | 16 | |
e501603b | 17 | /** |
f41f0342 | 18 | * Static instance to hold the table name. |
e501603b TO |
19 | * |
20 | * @var string | |
21 | */ | |
fa45b5b9 | 22 | public static $_tableName = 'civicrm_custom_group'; |
c3fc2621 | 23 | |
e501603b | 24 | /** |
f41f0342 | 25 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 26 | * |
c3fc2621 | 27 | * @var bool |
e501603b | 28 | */ |
fa45b5b9 | 29 | public static $_log = TRUE; |
c3fc2621 | 30 | |
e501603b TO |
31 | /** |
32 | * Unique Custom Group ID | |
33 | * | |
e6ca0a57 | 34 | * @var int |
e501603b TO |
35 | */ |
36 | public $id; | |
c3fc2621 | 37 | |
e501603b TO |
38 | /** |
39 | * Variable name/programmatic handle for this group. | |
40 | * | |
41 | * @var string | |
42 | */ | |
43 | public $name; | |
c3fc2621 | 44 | |
e501603b TO |
45 | /** |
46 | * Friendly Name. | |
47 | * | |
48 | * @var string | |
49 | */ | |
50 | public $title; | |
c3fc2621 | 51 | |
e501603b TO |
52 | /** |
53 | * Type of object this group extends (can add other options later e.g. contact_address, etc.). | |
54 | * | |
55 | * @var string | |
56 | */ | |
57 | public $extends; | |
c3fc2621 | 58 | |
e501603b TO |
59 | /** |
60 | * FK to civicrm_option_value.id (for option group custom_data_type.) | |
61 | * | |
e6ca0a57 | 62 | * @var int |
e501603b TO |
63 | */ |
64 | public $extends_entity_column_id; | |
c3fc2621 | 65 | |
e501603b TO |
66 | /** |
67 | * linking custom group for dynamic object | |
68 | * | |
69 | * @var string | |
70 | */ | |
71 | public $extends_entity_column_value; | |
c3fc2621 | 72 | |
e501603b TO |
73 | /** |
74 | * Visual relationship between this form and its parent. | |
75 | * | |
76 | * @var string | |
77 | */ | |
78 | public $style; | |
c3fc2621 | 79 | |
e501603b TO |
80 | /** |
81 | * Will this group be in collapsed or expanded mode on initial display ? | |
82 | * | |
e6ca0a57 | 83 | * @var int |
e501603b TO |
84 | */ |
85 | public $collapse_display; | |
c3fc2621 | 86 | |
e501603b TO |
87 | /** |
88 | * Description and/or help text to display before fields in form. | |
89 | * | |
90 | * @var text | |
91 | */ | |
92 | public $help_pre; | |
c3fc2621 | 93 | |
e501603b TO |
94 | /** |
95 | * Description and/or help text to display after fields in form. | |
96 | * | |
97 | * @var text | |
98 | */ | |
99 | public $help_post; | |
c3fc2621 | 100 | |
e501603b TO |
101 | /** |
102 | * Controls display order when multiple extended property groups are setup for the same class. | |
103 | * | |
104 | * @var int | |
105 | */ | |
106 | public $weight; | |
c3fc2621 | 107 | |
e501603b TO |
108 | /** |
109 | * Is this property active? | |
110 | * | |
e6ca0a57 | 111 | * @var bool |
e501603b TO |
112 | */ |
113 | public $is_active; | |
c3fc2621 | 114 | |
e501603b TO |
115 | /** |
116 | * Name of the table that holds the values for this group. | |
117 | * | |
118 | * @var string | |
119 | */ | |
120 | public $table_name; | |
c3fc2621 | 121 | |
e501603b TO |
122 | /** |
123 | * Does this group hold multiple values? | |
124 | * | |
e6ca0a57 | 125 | * @var bool |
e501603b TO |
126 | */ |
127 | public $is_multiple; | |
c3fc2621 | 128 | |
e501603b TO |
129 | /** |
130 | * minimum number of multiple records (typically 0?) | |
131 | * | |
e6ca0a57 | 132 | * @var int |
e501603b TO |
133 | */ |
134 | public $min_multiple; | |
c3fc2621 | 135 | |
e501603b TO |
136 | /** |
137 | * maximum number of multiple records, if 0 - no max | |
138 | * | |
e6ca0a57 | 139 | * @var int |
e501603b TO |
140 | */ |
141 | public $max_multiple; | |
c3fc2621 | 142 | |
e501603b TO |
143 | /** |
144 | * Will this group be in collapsed or expanded mode on advanced search display ? | |
145 | * | |
e6ca0a57 | 146 | * @var int |
e501603b TO |
147 | */ |
148 | public $collapse_adv_display; | |
c3fc2621 | 149 | |
e501603b TO |
150 | /** |
151 | * FK to civicrm_contact, who created this custom group | |
152 | * | |
e6ca0a57 | 153 | * @var int |
e501603b TO |
154 | */ |
155 | public $created_id; | |
c3fc2621 | 156 | |
e501603b TO |
157 | /** |
158 | * Date and time this custom group was created. | |
159 | * | |
160 | * @var datetime | |
161 | */ | |
162 | public $created_date; | |
c3fc2621 | 163 | |
e501603b TO |
164 | /** |
165 | * Is this a reserved Custom Group? | |
166 | * | |
e6ca0a57 | 167 | * @var bool |
e501603b TO |
168 | */ |
169 | public $is_reserved; | |
c3fc2621 | 170 | |
460931ca JP |
171 | /** |
172 | * Is this property public? | |
173 | * | |
e6ca0a57 | 174 | * @var bool |
460931ca JP |
175 | */ |
176 | public $is_public; | |
c3fc2621 | 177 | |
e501603b | 178 | /** |
f41f0342 | 179 | * Class constructor. |
e501603b | 180 | */ |
c3fc2621 | 181 | public function __construct() { |
e501603b TO |
182 | $this->__table = 'civicrm_custom_group'; |
183 | parent::__construct(); | |
184 | } | |
c3fc2621 | 185 | |
e501603b | 186 | /** |
f41f0342 | 187 | * Returns foreign keys and entity references. |
e501603b TO |
188 | * |
189 | * @return array | |
190 | * [CRM_Core_Reference_Interface] | |
191 | */ | |
c3fc2621 | 192 | public static function getReferenceColumns() { |
346aaaba | 193 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
fa45b5b9 | 194 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 | 195 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'created_id', 'civicrm_contact', 'id'); |
346aaaba | 196 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 197 | } |
346aaaba | 198 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 199 | } |
c3fc2621 | 200 | |
e501603b TO |
201 | /** |
202 | * Returns all the column names of this table | |
203 | * | |
204 | * @return array | |
205 | */ | |
c3fc2621 | 206 | public static function &fields() { |
346aaaba | 207 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
208 | Civi::$statics[__CLASS__]['fields'] = [ |
209 | 'id' => [ | |
e501603b TO |
210 | 'name' => 'id', |
211 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 212 | 'title' => ts('Custom Group ID'), |
215b423e | 213 | 'description' => ts('Unique Custom Group ID'), |
c3fc2621 | 214 | 'required' => TRUE, |
a36434b9 | 215 | 'where' => 'civicrm_custom_group.id', |
522a26c9 | 216 | 'table_name' => 'civicrm_custom_group', |
217 | 'entity' => 'CustomGroup', | |
218 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 219 | 'localizable' => 0, |
c3fc2621 CW |
220 | ], |
221 | 'name' => [ | |
e501603b TO |
222 | 'name' => 'name', |
223 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 224 | 'title' => ts('Custom Group Name'), |
215b423e | 225 | 'description' => ts('Variable name/programmatic handle for this group.'), |
e501603b TO |
226 | 'maxlength' => 64, |
227 | 'size' => CRM_Utils_Type::BIG, | |
a36434b9 | 228 | 'where' => 'civicrm_custom_group.name', |
522a26c9 | 229 | 'table_name' => 'civicrm_custom_group', |
230 | 'entity' => 'CustomGroup', | |
231 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 232 | 'localizable' => 0, |
c3fc2621 CW |
233 | ], |
234 | 'title' => [ | |
e501603b TO |
235 | 'name' => 'title', |
236 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 237 | 'title' => ts('Custom Group Title'), |
215b423e | 238 | 'description' => ts('Friendly Name.'), |
c3fc2621 | 239 | 'required' => TRUE, |
e501603b TO |
240 | 'maxlength' => 64, |
241 | 'size' => CRM_Utils_Type::BIG, | |
a36434b9 | 242 | 'where' => 'civicrm_custom_group.title', |
522a26c9 | 243 | 'table_name' => 'civicrm_custom_group', |
244 | 'entity' => 'CustomGroup', | |
245 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 246 | 'localizable' => 1, |
c3fc2621 CW |
247 | ], |
248 | 'extends' => [ | |
e501603b TO |
249 | 'name' => 'extends', |
250 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 251 | 'title' => ts('Custom Group Extends'), |
215b423e | 252 | 'description' => ts('Type of object this group extends (can add other options later e.g. contact_address, etc.).'), |
e501603b TO |
253 | 'maxlength' => 255, |
254 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 255 | 'where' => 'civicrm_custom_group.extends', |
e501603b | 256 | 'default' => 'Contact', |
522a26c9 | 257 | 'table_name' => 'civicrm_custom_group', |
258 | 'entity' => 'CustomGroup', | |
259 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 260 | 'localizable' => 0, |
c3fc2621 CW |
261 | ], |
262 | 'extends_entity_column_id' => [ | |
e501603b TO |
263 | 'name' => 'extends_entity_column_id', |
264 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 265 | 'title' => ts('Custom Group Subtype List'), |
215b423e | 266 | 'description' => ts('FK to civicrm_option_value.id (for option group custom_data_type.)'), |
a36434b9 | 267 | 'where' => 'civicrm_custom_group.extends_entity_column_id', |
e501603b | 268 | 'default' => 'NULL', |
522a26c9 | 269 | 'table_name' => 'civicrm_custom_group', |
270 | 'entity' => 'CustomGroup', | |
271 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 272 | 'localizable' => 0, |
233319bf | 273 | 'html' => [ |
274 | 'type' => 'Select', | |
275 | ], | |
276 | 'pseudoconstant' => [ | |
277 | 'optionGroupName' => 'custom_data_type', | |
278 | 'optionEditPath' => 'civicrm/admin/options/custom_data_type', | |
e6ca0a57 | 279 | ], |
c3fc2621 CW |
280 | ], |
281 | 'extends_entity_column_value' => [ | |
e501603b TO |
282 | 'name' => 'extends_entity_column_value', |
283 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 284 | 'title' => ts('Custom Group Subtype'), |
215b423e | 285 | 'description' => ts('linking custom group for dynamic object'), |
e501603b TO |
286 | 'maxlength' => 255, |
287 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 288 | 'where' => 'civicrm_custom_group.extends_entity_column_value', |
522a26c9 | 289 | 'table_name' => 'civicrm_custom_group', |
290 | 'entity' => 'CustomGroup', | |
291 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 292 | 'localizable' => 0, |
2a5c9b4d | 293 | 'serialize' => self::SERIALIZE_SEPARATOR_BOOKEND, |
c3fc2621 CW |
294 | ], |
295 | 'style' => [ | |
e501603b TO |
296 | 'name' => 'style', |
297 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 298 | 'title' => ts('Custom Group Style'), |
215b423e | 299 | 'description' => ts('Visual relationship between this form and its parent.'), |
e501603b TO |
300 | 'maxlength' => 15, |
301 | 'size' => CRM_Utils_Type::TWELVE, | |
a36434b9 | 302 | 'where' => 'civicrm_custom_group.style', |
522a26c9 | 303 | 'table_name' => 'civicrm_custom_group', |
304 | 'entity' => 'CustomGroup', | |
305 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 306 | 'localizable' => 0, |
c3fc2621 | 307 | 'html' => [ |
e501603b | 308 | 'type' => 'Select', |
c3fc2621 CW |
309 | ], |
310 | 'pseudoconstant' => [ | |
e501603b | 311 | 'callback' => 'CRM_Core_SelectValues::customGroupStyle', |
e6ca0a57 | 312 | ], |
c3fc2621 CW |
313 | ], |
314 | 'collapse_display' => [ | |
e501603b TO |
315 | 'name' => 'collapse_display', |
316 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 317 | 'title' => ts('Collapse Custom Group?'), |
215b423e | 318 | 'description' => ts('Will this group be in collapsed or expanded mode on initial display ?'), |
a36434b9 | 319 | 'where' => 'civicrm_custom_group.collapse_display', |
45a83e42 | 320 | 'default' => '0', |
522a26c9 | 321 | 'table_name' => 'civicrm_custom_group', |
322 | 'entity' => 'CustomGroup', | |
323 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 324 | 'localizable' => 0, |
c3fc2621 CW |
325 | ], |
326 | 'help_pre' => [ | |
e501603b TO |
327 | 'name' => 'help_pre', |
328 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 329 | 'title' => ts('Custom Group Pre Text'), |
215b423e | 330 | 'description' => ts('Description and/or help text to display before fields in form.'), |
e501603b TO |
331 | 'rows' => 4, |
332 | 'cols' => 80, | |
a36434b9 | 333 | 'where' => 'civicrm_custom_group.help_pre', |
522a26c9 | 334 | 'table_name' => 'civicrm_custom_group', |
335 | 'entity' => 'CustomGroup', | |
336 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 337 | 'localizable' => 1, |
c3fc2621 | 338 | 'html' => [ |
e501603b | 339 | 'type' => 'TextArea', |
c3fc2621 CW |
340 | ], |
341 | ], | |
342 | 'help_post' => [ | |
e501603b TO |
343 | 'name' => 'help_post', |
344 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 345 | 'title' => ts('Custom Group Post Text'), |
215b423e | 346 | 'description' => ts('Description and/or help text to display after fields in form.'), |
e501603b TO |
347 | 'rows' => 4, |
348 | 'cols' => 80, | |
a36434b9 | 349 | 'where' => 'civicrm_custom_group.help_post', |
522a26c9 | 350 | 'table_name' => 'civicrm_custom_group', |
351 | 'entity' => 'CustomGroup', | |
352 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 353 | 'localizable' => 1, |
c3fc2621 | 354 | 'html' => [ |
e501603b | 355 | 'type' => 'TextArea', |
c3fc2621 CW |
356 | ], |
357 | ], | |
358 | 'weight' => [ | |
e501603b TO |
359 | 'name' => 'weight', |
360 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 361 | 'title' => ts('Order'), |
215b423e | 362 | 'description' => ts('Controls display order when multiple extended property groups are setup for the same class.'), |
c3fc2621 | 363 | 'required' => TRUE, |
a36434b9 | 364 | 'where' => 'civicrm_custom_group.weight', |
e501603b | 365 | 'default' => '1', |
522a26c9 | 366 | 'table_name' => 'civicrm_custom_group', |
367 | 'entity' => 'CustomGroup', | |
368 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 369 | 'localizable' => 0, |
c3fc2621 CW |
370 | ], |
371 | 'is_active' => [ | |
e501603b TO |
372 | 'name' => 'is_active', |
373 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 374 | 'title' => ts('Custom Group Is Active?'), |
215b423e | 375 | 'description' => ts('Is this property active?'), |
a36434b9 | 376 | 'where' => 'civicrm_custom_group.is_active', |
110f4343 | 377 | 'default' => '1', |
522a26c9 | 378 | 'table_name' => 'civicrm_custom_group', |
379 | 'entity' => 'CustomGroup', | |
380 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 381 | 'localizable' => 0, |
c3fc2621 CW |
382 | ], |
383 | 'table_name' => [ | |
e501603b TO |
384 | 'name' => 'table_name', |
385 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 386 | 'title' => ts('Table Name'), |
215b423e | 387 | 'description' => ts('Name of the table that holds the values for this group.'), |
e501603b TO |
388 | 'maxlength' => 255, |
389 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 390 | 'where' => 'civicrm_custom_group.table_name', |
522a26c9 | 391 | 'table_name' => 'civicrm_custom_group', |
392 | 'entity' => 'CustomGroup', | |
393 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 394 | 'localizable' => 0, |
c3fc2621 CW |
395 | ], |
396 | 'is_multiple' => [ | |
e501603b TO |
397 | 'name' => 'is_multiple', |
398 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 399 | 'title' => ts('Supports Multiple Records'), |
215b423e | 400 | 'description' => ts('Does this group hold multiple values?'), |
a36434b9 | 401 | 'where' => 'civicrm_custom_group.is_multiple', |
45a83e42 | 402 | 'default' => '0', |
522a26c9 | 403 | 'table_name' => 'civicrm_custom_group', |
404 | 'entity' => 'CustomGroup', | |
405 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 406 | 'localizable' => 0, |
c3fc2621 CW |
407 | ], |
408 | 'min_multiple' => [ | |
e501603b TO |
409 | 'name' => 'min_multiple', |
410 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 411 | 'title' => ts('Minimum Multiple Records'), |
215b423e | 412 | 'description' => ts('minimum number of multiple records (typically 0?)'), |
a36434b9 | 413 | 'where' => 'civicrm_custom_group.min_multiple', |
522a26c9 | 414 | 'table_name' => 'civicrm_custom_group', |
415 | 'entity' => 'CustomGroup', | |
416 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 417 | 'localizable' => 0, |
c3fc2621 CW |
418 | ], |
419 | 'max_multiple' => [ | |
e501603b TO |
420 | 'name' => 'max_multiple', |
421 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 422 | 'title' => ts('Maximum Multiple Records'), |
215b423e | 423 | 'description' => ts('maximum number of multiple records, if 0 - no max'), |
a36434b9 | 424 | 'where' => 'civicrm_custom_group.max_multiple', |
522a26c9 | 425 | 'table_name' => 'civicrm_custom_group', |
426 | 'entity' => 'CustomGroup', | |
427 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 428 | 'localizable' => 0, |
c3fc2621 CW |
429 | ], |
430 | 'collapse_adv_display' => [ | |
e501603b TO |
431 | 'name' => 'collapse_adv_display', |
432 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 433 | 'title' => ts('Collapse Group Display'), |
215b423e | 434 | 'description' => ts('Will this group be in collapsed or expanded mode on advanced search display ?'), |
a36434b9 | 435 | 'where' => 'civicrm_custom_group.collapse_adv_display', |
45a83e42 | 436 | 'default' => '0', |
522a26c9 | 437 | 'table_name' => 'civicrm_custom_group', |
438 | 'entity' => 'CustomGroup', | |
439 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 440 | 'localizable' => 0, |
c3fc2621 CW |
441 | ], |
442 | 'created_id' => [ | |
e501603b TO |
443 | 'name' => 'created_id', |
444 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 445 | 'title' => ts('Custom Group Created By'), |
215b423e | 446 | 'description' => ts('FK to civicrm_contact, who created this custom group'), |
a36434b9 | 447 | 'where' => 'civicrm_custom_group.created_id', |
522a26c9 | 448 | 'table_name' => 'civicrm_custom_group', |
449 | 'entity' => 'CustomGroup', | |
450 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 451 | 'localizable' => 0, |
e501603b | 452 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
c3fc2621 CW |
453 | ], |
454 | 'created_date' => [ | |
e501603b TO |
455 | 'name' => 'created_date', |
456 | 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, | |
c3fc2621 | 457 | 'title' => ts('Custom Group Created Date'), |
215b423e | 458 | 'description' => ts('Date and time this custom group was created.'), |
a36434b9 | 459 | 'where' => 'civicrm_custom_group.created_date', |
522a26c9 | 460 | 'table_name' => 'civicrm_custom_group', |
461 | 'entity' => 'CustomGroup', | |
462 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 463 | 'localizable' => 0, |
c3fc2621 CW |
464 | ], |
465 | 'is_reserved' => [ | |
e501603b TO |
466 | 'name' => 'is_reserved', |
467 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 468 | 'title' => ts('Reserved Group?'), |
215b423e | 469 | 'description' => ts('Is this a reserved Custom Group?'), |
a36434b9 | 470 | 'where' => 'civicrm_custom_group.is_reserved', |
45a83e42 | 471 | 'default' => '0', |
522a26c9 | 472 | 'table_name' => 'civicrm_custom_group', |
473 | 'entity' => 'CustomGroup', | |
474 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
6a7e5e5d | 475 | 'localizable' => 0, |
c3fc2621 CW |
476 | ], |
477 | 'is_public' => [ | |
460931ca JP |
478 | 'name' => 'is_public', |
479 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 480 | 'title' => ts('Custom Group Is Public?'), |
215b423e | 481 | 'description' => ts('Is this property public?'), |
a36434b9 | 482 | 'where' => 'civicrm_custom_group.is_public', |
460931ca JP |
483 | 'default' => '1', |
484 | 'table_name' => 'civicrm_custom_group', | |
485 | 'entity' => 'CustomGroup', | |
486 | 'bao' => 'CRM_Core_BAO_CustomGroup', | |
487 | 'localizable' => 0, | |
c3fc2621 CW |
488 | ], |
489 | ]; | |
346aaaba | 490 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 491 | } |
346aaaba | 492 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 493 | } |
c3fc2621 | 494 | |
e501603b | 495 | /** |
bd8e0b14 | 496 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
497 | * |
498 | * @return array | |
bd8e0b14 | 499 | * Array(string $name => string $uniqueName). |
e501603b | 500 | */ |
c3fc2621 | 501 | public static function &fieldKeys() { |
bd8e0b14 TO |
502 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
503 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 504 | } |
bd8e0b14 | 505 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 506 | } |
c3fc2621 | 507 | |
e501603b TO |
508 | /** |
509 | * Returns the names of this table | |
510 | * | |
511 | * @return string | |
512 | */ | |
c3fc2621 | 513 | public static function getTableName() { |
e501603b TO |
514 | return CRM_Core_DAO::getLocaleTableName(self::$_tableName); |
515 | } | |
c3fc2621 | 516 | |
e501603b TO |
517 | /** |
518 | * Returns if this table needs to be logged | |
519 | * | |
c3fc2621 | 520 | * @return bool |
e501603b | 521 | */ |
c3fc2621 | 522 | public function getLog() { |
e501603b TO |
523 | return self::$_log; |
524 | } | |
c3fc2621 | 525 | |
e501603b TO |
526 | /** |
527 | * Returns the list of fields that can be imported | |
528 | * | |
529 | * @param bool $prefix | |
530 | * | |
531 | * @return array | |
532 | */ | |
c3fc2621 CW |
533 | public static function &import($prefix = FALSE) { |
534 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'custom_group', $prefix, []); | |
60808919 | 535 | return $r; |
e501603b | 536 | } |
c3fc2621 | 537 | |
e501603b TO |
538 | /** |
539 | * Returns the list of fields that can be exported | |
540 | * | |
541 | * @param bool $prefix | |
542 | * | |
543 | * @return array | |
544 | */ | |
c3fc2621 CW |
545 | public static function &export($prefix = FALSE) { |
546 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'custom_group', $prefix, []); | |
60808919 | 547 | return $r; |
e501603b | 548 | } |
c3fc2621 | 549 | |
e7a6b91a AS |
550 | /** |
551 | * Returns the list of indices | |
c3fc2621 CW |
552 | * |
553 | * @param bool $localize | |
554 | * | |
555 | * @return array | |
e7a6b91a AS |
556 | */ |
557 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
558 | $indices = [ |
559 | 'UI_title_extends' => [ | |
e7a6b91a | 560 | 'name' => 'UI_title_extends', |
c3fc2621 | 561 | 'field' => [ |
e7a6b91a AS |
562 | 0 => 'title', |
563 | 1 => 'extends', | |
c3fc2621 CW |
564 | ], |
565 | 'localizable' => TRUE, | |
566 | 'unique' => TRUE, | |
e7a6b91a | 567 | 'sig' => 'civicrm_custom_group::1::title::extends', |
c3fc2621 CW |
568 | ], |
569 | 'UI_name_extends' => [ | |
e7a6b91a | 570 | 'name' => 'UI_name_extends', |
c3fc2621 | 571 | 'field' => [ |
e7a6b91a AS |
572 | 0 => 'name', |
573 | 1 => 'extends', | |
c3fc2621 CW |
574 | ], |
575 | 'localizable' => FALSE, | |
576 | 'unique' => TRUE, | |
e7a6b91a | 577 | 'sig' => 'civicrm_custom_group::1::name::extends', |
c3fc2621 CW |
578 | ], |
579 | ]; | |
e7a6b91a AS |
580 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
581 | } | |
c3fc2621 | 582 | |
e501603b | 583 | } |