Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
ca5cec67 | 5 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Contact/Group.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
a9d0587b | 9 | * (GenCodeChecksum:a8a3812a392b7544441cdbe1f9500f21) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the Group entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Contact_DAO_Group 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_group'; |
c3fc2621 | 23 | |
449c4e6b CW |
24 | /** |
25 | * Icon associated with this entity. | |
26 | * | |
27 | * @var string | |
28 | */ | |
29 | public static $_icon = 'fa-users'; | |
30 | ||
e501603b | 31 | /** |
f41f0342 | 32 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 33 | * |
c3fc2621 | 34 | * @var bool |
e501603b | 35 | */ |
fa45b5b9 | 36 | public static $_log = TRUE; |
c3fc2621 | 37 | |
e501603b TO |
38 | /** |
39 | * Group ID | |
40 | * | |
e6ca0a57 | 41 | * @var int |
e501603b TO |
42 | */ |
43 | public $id; | |
c3fc2621 | 44 | |
e501603b TO |
45 | /** |
46 | * Internal name of Group. | |
47 | * | |
48 | * @var string | |
49 | */ | |
50 | public $name; | |
c3fc2621 | 51 | |
e501603b TO |
52 | /** |
53 | * Name of Group. | |
54 | * | |
55 | * @var string | |
56 | */ | |
57 | public $title; | |
c3fc2621 | 58 | |
e501603b TO |
59 | /** |
60 | * Optional verbose description of the group. | |
61 | * | |
62 | * @var text | |
63 | */ | |
64 | public $description; | |
c3fc2621 | 65 | |
e501603b TO |
66 | /** |
67 | * Module or process which created this group. | |
68 | * | |
69 | * @var string | |
70 | */ | |
71 | public $source; | |
c3fc2621 | 72 | |
e501603b TO |
73 | /** |
74 | * FK to saved search table. | |
75 | * | |
e6ca0a57 | 76 | * @var int |
e501603b TO |
77 | */ |
78 | public $saved_search_id; | |
c3fc2621 | 79 | |
e501603b TO |
80 | /** |
81 | * Is this entry active? | |
82 | * | |
e6ca0a57 | 83 | * @var bool |
e501603b TO |
84 | */ |
85 | public $is_active; | |
c3fc2621 | 86 | |
e501603b TO |
87 | /** |
88 | * In what context(s) is this field visible. | |
89 | * | |
90 | * @var string | |
91 | */ | |
92 | public $visibility; | |
c3fc2621 | 93 | |
e501603b TO |
94 | /** |
95 | * the sql where clause if a saved search acl | |
96 | * | |
97 | * @var text | |
98 | */ | |
99 | public $where_clause; | |
c3fc2621 | 100 | |
e501603b TO |
101 | /** |
102 | * the tables to be included in a select data | |
103 | * | |
104 | * @var text | |
105 | */ | |
106 | public $select_tables; | |
c3fc2621 | 107 | |
e501603b TO |
108 | /** |
109 | * the tables to be included in the count statement | |
110 | * | |
111 | * @var text | |
112 | */ | |
113 | public $where_tables; | |
c3fc2621 | 114 | |
e501603b TO |
115 | /** |
116 | * FK to group type | |
117 | * | |
118 | * @var string | |
119 | */ | |
120 | public $group_type; | |
c3fc2621 | 121 | |
e501603b TO |
122 | /** |
123 | * Date when we created the cache for a smart group | |
124 | * | |
125 | * @var timestamp | |
126 | */ | |
127 | public $cache_date; | |
c3fc2621 | 128 | |
e501603b TO |
129 | /** |
130 | * Date and time when we need to refresh the cache next. | |
131 | * | |
132 | * @var timestamp | |
133 | */ | |
134 | public $refresh_date; | |
c3fc2621 | 135 | |
e501603b TO |
136 | /** |
137 | * IDs of the parent(s) | |
138 | * | |
139 | * @var text | |
140 | */ | |
141 | public $parents; | |
c3fc2621 | 142 | |
e501603b TO |
143 | /** |
144 | * IDs of the child(ren) | |
145 | * | |
146 | * @var text | |
147 | */ | |
148 | public $children; | |
c3fc2621 | 149 | |
e501603b TO |
150 | /** |
151 | * Is this group hidden? | |
152 | * | |
e6ca0a57 | 153 | * @var bool |
e501603b TO |
154 | */ |
155 | public $is_hidden; | |
c3fc2621 | 156 | |
e501603b | 157 | /** |
e6ca0a57 | 158 | * @var bool |
e501603b TO |
159 | */ |
160 | public $is_reserved; | |
c3fc2621 | 161 | |
e501603b TO |
162 | /** |
163 | * FK to contact table. | |
164 | * | |
e6ca0a57 | 165 | * @var int |
e501603b TO |
166 | */ |
167 | public $created_id; | |
c3fc2621 | 168 | |
e501603b TO |
169 | /** |
170 | * FK to contact table. | |
171 | * | |
e6ca0a57 | 172 | * @var int |
e501603b TO |
173 | */ |
174 | public $modified_id; | |
c3fc2621 | 175 | |
e501603b | 176 | /** |
f41f0342 | 177 | * Class constructor. |
e501603b | 178 | */ |
c3fc2621 | 179 | public function __construct() { |
e501603b TO |
180 | $this->__table = 'civicrm_group'; |
181 | parent::__construct(); | |
182 | } | |
c3fc2621 | 183 | |
449c4e6b CW |
184 | /** |
185 | * Returns localized title of this entity. | |
186 | */ | |
187 | public static function getEntityTitle() { | |
188 | return ts('Groups'); | |
189 | } | |
190 | ||
e501603b | 191 | /** |
f41f0342 | 192 | * Returns foreign keys and entity references. |
e501603b TO |
193 | * |
194 | * @return array | |
195 | * [CRM_Core_Reference_Interface] | |
196 | */ | |
c3fc2621 | 197 | public static function getReferenceColumns() { |
346aaaba | 198 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
fa45b5b9 | 199 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 CW |
200 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'saved_search_id', 'civicrm_saved_search', 'id'); |
201 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'created_id', 'civicrm_contact', 'id'); | |
202 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'modified_id', 'civicrm_contact', 'id'); | |
346aaaba | 203 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 204 | } |
346aaaba | 205 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 206 | } |
c3fc2621 | 207 | |
e501603b TO |
208 | /** |
209 | * Returns all the column names of this table | |
210 | * | |
211 | * @return array | |
212 | */ | |
c3fc2621 | 213 | public static function &fields() { |
346aaaba | 214 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
215 | Civi::$statics[__CLASS__]['fields'] = [ |
216 | 'id' => [ | |
e501603b TO |
217 | 'name' => 'id', |
218 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 219 | 'title' => ts('Group ID'), |
215b423e | 220 | 'description' => ts('Group ID'), |
c3fc2621 | 221 | 'required' => TRUE, |
a36434b9 | 222 | 'where' => 'civicrm_group.id', |
522a26c9 | 223 | 'table_name' => 'civicrm_group', |
224 | 'entity' => 'Group', | |
225 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 226 | 'localizable' => 0, |
a9d0587b | 227 | 'add' => '1.1', |
c3fc2621 CW |
228 | ], |
229 | 'name' => [ | |
e501603b TO |
230 | 'name' => 'name', |
231 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 232 | 'title' => ts('Group Name'), |
215b423e | 233 | 'description' => ts('Internal name of Group.'), |
e501603b TO |
234 | 'maxlength' => 64, |
235 | 'size' => CRM_Utils_Type::BIG, | |
a36434b9 | 236 | 'where' => 'civicrm_group.name', |
522a26c9 | 237 | 'table_name' => 'civicrm_group', |
238 | 'entity' => 'Group', | |
239 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 240 | 'localizable' => 0, |
a9d0587b | 241 | 'add' => '1.1', |
c3fc2621 CW |
242 | ], |
243 | 'title' => [ | |
e501603b TO |
244 | 'name' => 'title', |
245 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 246 | 'title' => ts('Group Title'), |
215b423e | 247 | 'description' => ts('Name of Group.'), |
e501603b TO |
248 | 'maxlength' => 64, |
249 | 'size' => CRM_Utils_Type::BIG, | |
a36434b9 | 250 | 'where' => 'civicrm_group.title', |
522a26c9 | 251 | 'table_name' => 'civicrm_group', |
252 | 'entity' => 'Group', | |
253 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 254 | 'localizable' => 1, |
7da21f11 | 255 | 'html' => [ |
256 | 'type' => 'Text', | |
257 | ], | |
a9d0587b | 258 | 'add' => '1.1', |
c3fc2621 CW |
259 | ], |
260 | 'description' => [ | |
e501603b TO |
261 | 'name' => 'description', |
262 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 263 | 'title' => ts('Group Description'), |
215b423e | 264 | 'description' => ts('Optional verbose description of the group.'), |
e501603b TO |
265 | 'rows' => 2, |
266 | 'cols' => 60, | |
a36434b9 | 267 | 'where' => 'civicrm_group.description', |
522a26c9 | 268 | 'table_name' => 'civicrm_group', |
269 | 'entity' => 'Group', | |
270 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 271 | 'localizable' => 0, |
c3fc2621 | 272 | 'html' => [ |
e501603b | 273 | 'type' => 'TextArea', |
c3fc2621 | 274 | ], |
a9d0587b | 275 | 'add' => '1.1', |
c3fc2621 CW |
276 | ], |
277 | 'source' => [ | |
e501603b TO |
278 | 'name' => 'source', |
279 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 280 | 'title' => ts('Group Source'), |
215b423e | 281 | 'description' => ts('Module or process which created this group.'), |
e501603b TO |
282 | 'maxlength' => 64, |
283 | 'size' => CRM_Utils_Type::BIG, | |
a36434b9 | 284 | 'where' => 'civicrm_group.source', |
522a26c9 | 285 | 'table_name' => 'civicrm_group', |
286 | 'entity' => 'Group', | |
287 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 288 | 'localizable' => 0, |
a9d0587b | 289 | 'add' => '1.1', |
c3fc2621 CW |
290 | ], |
291 | 'saved_search_id' => [ | |
e501603b TO |
292 | 'name' => 'saved_search_id', |
293 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 294 | 'title' => ts('Saved Search ID'), |
215b423e | 295 | 'description' => ts('FK to saved search table.'), |
a36434b9 | 296 | 'where' => 'civicrm_group.saved_search_id', |
522a26c9 | 297 | 'table_name' => 'civicrm_group', |
298 | 'entity' => 'Group', | |
299 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 300 | 'localizable' => 0, |
e501603b | 301 | 'FKClassName' => 'CRM_Contact_DAO_SavedSearch', |
a9d0587b | 302 | 'add' => '1.1', |
c3fc2621 CW |
303 | ], |
304 | 'is_active' => [ | |
e501603b TO |
305 | 'name' => 'is_active', |
306 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 307 | 'title' => ts('Group Enabled'), |
215b423e | 308 | 'description' => ts('Is this entry active?'), |
a36434b9 | 309 | 'where' => 'civicrm_group.is_active', |
522a26c9 | 310 | 'table_name' => 'civicrm_group', |
311 | 'entity' => 'Group', | |
312 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 313 | 'localizable' => 0, |
a9d0587b | 314 | 'add' => '1.1', |
c3fc2621 CW |
315 | ], |
316 | 'visibility' => [ | |
e501603b TO |
317 | 'name' => 'visibility', |
318 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 319 | 'title' => ts('Group Visibility Setting'), |
215b423e | 320 | 'description' => ts('In what context(s) is this field visible.'), |
e501603b TO |
321 | 'maxlength' => 24, |
322 | 'size' => CRM_Utils_Type::MEDIUM, | |
a36434b9 | 323 | 'where' => 'civicrm_group.visibility', |
e501603b | 324 | 'default' => 'User and User Admin Only', |
522a26c9 | 325 | 'table_name' => 'civicrm_group', |
326 | 'entity' => 'Group', | |
327 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 328 | 'localizable' => 0, |
c3fc2621 | 329 | 'html' => [ |
e501603b | 330 | 'type' => 'Select', |
c3fc2621 CW |
331 | ], |
332 | 'pseudoconstant' => [ | |
e501603b | 333 | 'callback' => 'CRM_Core_SelectValues::groupVisibility', |
e6ca0a57 | 334 | ], |
a9d0587b | 335 | 'add' => '1.2', |
c3fc2621 CW |
336 | ], |
337 | 'where_clause' => [ | |
e501603b TO |
338 | 'name' => 'where_clause', |
339 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 340 | 'title' => ts('Group Where Clause'), |
215b423e | 341 | 'description' => ts('the sql where clause if a saved search acl'), |
a36434b9 | 342 | 'where' => 'civicrm_group.where_clause', |
522a26c9 | 343 | 'table_name' => 'civicrm_group', |
344 | 'entity' => 'Group', | |
345 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 346 | 'localizable' => 0, |
a9d0587b | 347 | 'add' => '1.6', |
c3fc2621 CW |
348 | ], |
349 | 'select_tables' => [ | |
e501603b TO |
350 | 'name' => 'select_tables', |
351 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 352 | 'title' => ts('Tables For Select Clause'), |
215b423e | 353 | 'description' => ts('the tables to be included in a select data'), |
a36434b9 | 354 | 'where' => 'civicrm_group.select_tables', |
522a26c9 | 355 | 'table_name' => 'civicrm_group', |
356 | 'entity' => 'Group', | |
357 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 358 | 'localizable' => 0, |
2a5c9b4d | 359 | 'serialize' => self::SERIALIZE_PHP, |
a9d0587b | 360 | 'add' => '1.6', |
c3fc2621 CW |
361 | ], |
362 | 'where_tables' => [ | |
e501603b TO |
363 | 'name' => 'where_tables', |
364 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 365 | 'title' => ts('Tables For Where Clause'), |
215b423e | 366 | 'description' => ts('the tables to be included in the count statement'), |
a36434b9 | 367 | 'where' => 'civicrm_group.where_tables', |
522a26c9 | 368 | 'table_name' => 'civicrm_group', |
369 | 'entity' => 'Group', | |
370 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 371 | 'localizable' => 0, |
2a5c9b4d | 372 | 'serialize' => self::SERIALIZE_PHP, |
a9d0587b | 373 | 'add' => '1.6', |
c3fc2621 CW |
374 | ], |
375 | 'group_type' => [ | |
e501603b TO |
376 | 'name' => 'group_type', |
377 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 378 | 'title' => ts('Group Type'), |
215b423e | 379 | 'description' => ts('FK to group type'), |
e501603b TO |
380 | 'maxlength' => 128, |
381 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 382 | 'where' => 'civicrm_group.group_type', |
522a26c9 | 383 | 'table_name' => 'civicrm_group', |
384 | 'entity' => 'Group', | |
385 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 386 | 'localizable' => 0, |
2a5c9b4d | 387 | 'serialize' => self::SERIALIZE_SEPARATOR_BOOKEND, |
c3fc2621 | 388 | 'pseudoconstant' => [ |
e501603b TO |
389 | 'optionGroupName' => 'group_type', |
390 | 'optionEditPath' => 'civicrm/admin/options/group_type', | |
e6ca0a57 | 391 | ], |
a9d0587b | 392 | 'add' => '1.9', |
c3fc2621 CW |
393 | ], |
394 | 'cache_date' => [ | |
e501603b TO |
395 | 'name' => 'cache_date', |
396 | 'type' => CRM_Utils_Type::T_TIMESTAMP, | |
c3fc2621 | 397 | 'title' => ts('Group Cache Date'), |
215b423e | 398 | 'description' => ts('Date when we created the cache for a smart group'), |
c3fc2621 | 399 | 'required' => FALSE, |
a36434b9 | 400 | 'where' => 'civicrm_group.cache_date', |
522a26c9 | 401 | 'table_name' => 'civicrm_group', |
402 | 'entity' => 'Group', | |
403 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 404 | 'localizable' => 0, |
a9d0587b | 405 | 'add' => '2.1', |
c3fc2621 CW |
406 | ], |
407 | 'refresh_date' => [ | |
e501603b TO |
408 | 'name' => 'refresh_date', |
409 | 'type' => CRM_Utils_Type::T_TIMESTAMP, | |
c3fc2621 | 410 | 'title' => ts('Next Group Refresh Time'), |
215b423e | 411 | 'description' => ts('Date and time when we need to refresh the cache next.'), |
c3fc2621 | 412 | 'required' => FALSE, |
a36434b9 | 413 | 'where' => 'civicrm_group.refresh_date', |
522a26c9 | 414 | 'table_name' => 'civicrm_group', |
415 | 'entity' => 'Group', | |
416 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 417 | 'localizable' => 0, |
a9d0587b | 418 | 'add' => '4.3', |
c3fc2621 CW |
419 | ], |
420 | 'parents' => [ | |
e501603b TO |
421 | 'name' => 'parents', |
422 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 423 | 'title' => ts('Group Parents'), |
215b423e | 424 | 'description' => ts('IDs of the parent(s)'), |
a36434b9 | 425 | 'where' => 'civicrm_group.parents', |
522a26c9 | 426 | 'table_name' => 'civicrm_group', |
427 | 'entity' => 'Group', | |
428 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 429 | 'localizable' => 0, |
30208fab | 430 | 'serialize' => self::SERIALIZE_COMMA, |
1678a63b | 431 | 'pseudoconstant' => [ |
432 | 'callback' => 'CRM_Core_PseudoConstant::allGroup', | |
e6ca0a57 | 433 | ], |
a9d0587b | 434 | 'add' => '2.1', |
c3fc2621 CW |
435 | ], |
436 | 'children' => [ | |
e501603b TO |
437 | 'name' => 'children', |
438 | 'type' => CRM_Utils_Type::T_TEXT, | |
c3fc2621 | 439 | 'title' => ts('Group Children'), |
215b423e | 440 | 'description' => ts('IDs of the child(ren)'), |
a36434b9 | 441 | 'where' => 'civicrm_group.children', |
522a26c9 | 442 | 'table_name' => 'civicrm_group', |
443 | 'entity' => 'Group', | |
444 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 445 | 'localizable' => 0, |
a9d0587b | 446 | 'add' => '2.1', |
c3fc2621 CW |
447 | ], |
448 | 'is_hidden' => [ | |
e501603b TO |
449 | 'name' => 'is_hidden', |
450 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 451 | 'title' => ts('Group is Hidden'), |
215b423e | 452 | 'description' => ts('Is this group hidden?'), |
a36434b9 | 453 | 'where' => 'civicrm_group.is_hidden', |
45a83e42 | 454 | 'default' => '0', |
522a26c9 | 455 | 'table_name' => 'civicrm_group', |
456 | 'entity' => 'Group', | |
457 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 458 | 'localizable' => 0, |
a9d0587b | 459 | 'add' => '2.2', |
c3fc2621 CW |
460 | ], |
461 | 'is_reserved' => [ | |
e501603b TO |
462 | 'name' => 'is_reserved', |
463 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 464 | 'title' => ts('Group is Reserved'), |
a36434b9 | 465 | 'where' => 'civicrm_group.is_reserved', |
45a83e42 | 466 | 'default' => '0', |
522a26c9 | 467 | 'table_name' => 'civicrm_group', |
468 | 'entity' => 'Group', | |
469 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 470 | 'localizable' => 0, |
a9d0587b | 471 | 'add' => '4.2', |
c3fc2621 CW |
472 | ], |
473 | 'created_id' => [ | |
e501603b TO |
474 | 'name' => 'created_id', |
475 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 476 | 'title' => ts('Group Created By'), |
215b423e | 477 | 'description' => ts('FK to contact table.'), |
a36434b9 | 478 | 'where' => 'civicrm_group.created_id', |
522a26c9 | 479 | 'table_name' => 'civicrm_group', |
480 | 'entity' => 'Group', | |
481 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 482 | 'localizable' => 0, |
e501603b | 483 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
a9d0587b | 484 | 'add' => '4.3', |
c3fc2621 CW |
485 | ], |
486 | 'modified_id' => [ | |
e501603b TO |
487 | 'name' => 'modified_id', |
488 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 489 | 'title' => ts('Group Modified By'), |
215b423e | 490 | 'description' => ts('FK to contact table.'), |
a36434b9 | 491 | 'where' => 'civicrm_group.modified_id', |
522a26c9 | 492 | 'table_name' => 'civicrm_group', |
493 | 'entity' => 'Group', | |
494 | 'bao' => 'CRM_Contact_BAO_Group', | |
6a7e5e5d | 495 | 'localizable' => 0, |
e501603b | 496 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
a9d0587b | 497 | 'add' => '4.5', |
c3fc2621 CW |
498 | ], |
499 | ]; | |
346aaaba | 500 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 501 | } |
346aaaba | 502 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 503 | } |
c3fc2621 | 504 | |
e501603b | 505 | /** |
bd8e0b14 | 506 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
507 | * |
508 | * @return array | |
bd8e0b14 | 509 | * Array(string $name => string $uniqueName). |
e501603b | 510 | */ |
c3fc2621 | 511 | public static function &fieldKeys() { |
bd8e0b14 TO |
512 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
513 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 514 | } |
bd8e0b14 | 515 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 516 | } |
c3fc2621 | 517 | |
e501603b TO |
518 | /** |
519 | * Returns the names of this table | |
520 | * | |
521 | * @return string | |
522 | */ | |
c3fc2621 | 523 | public static function getTableName() { |
e501603b TO |
524 | return CRM_Core_DAO::getLocaleTableName(self::$_tableName); |
525 | } | |
c3fc2621 | 526 | |
e501603b TO |
527 | /** |
528 | * Returns if this table needs to be logged | |
529 | * | |
c3fc2621 | 530 | * @return bool |
e501603b | 531 | */ |
c3fc2621 | 532 | public function getLog() { |
e501603b TO |
533 | return self::$_log; |
534 | } | |
c3fc2621 | 535 | |
e501603b TO |
536 | /** |
537 | * Returns the list of fields that can be imported | |
538 | * | |
539 | * @param bool $prefix | |
540 | * | |
541 | * @return array | |
542 | */ | |
c3fc2621 CW |
543 | public static function &import($prefix = FALSE) { |
544 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'group', $prefix, []); | |
60808919 | 545 | return $r; |
e501603b | 546 | } |
c3fc2621 | 547 | |
e501603b TO |
548 | /** |
549 | * Returns the list of fields that can be exported | |
550 | * | |
551 | * @param bool $prefix | |
552 | * | |
553 | * @return array | |
554 | */ | |
c3fc2621 CW |
555 | public static function &export($prefix = FALSE) { |
556 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'group', $prefix, []); | |
60808919 | 557 | return $r; |
e501603b | 558 | } |
c3fc2621 | 559 | |
e7a6b91a AS |
560 | /** |
561 | * Returns the list of indices | |
c3fc2621 CW |
562 | * |
563 | * @param bool $localize | |
564 | * | |
565 | * @return array | |
e7a6b91a AS |
566 | */ |
567 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
568 | $indices = [ |
569 | 'index_group_type' => [ | |
e7a6b91a | 570 | 'name' => 'index_group_type', |
c3fc2621 | 571 | 'field' => [ |
e7a6b91a | 572 | 0 => 'group_type', |
c3fc2621 CW |
573 | ], |
574 | 'localizable' => FALSE, | |
e7a6b91a | 575 | 'sig' => 'civicrm_group::0::group_type', |
c3fc2621 CW |
576 | ], |
577 | 'UI_title' => [ | |
e7a6b91a | 578 | 'name' => 'UI_title', |
c3fc2621 | 579 | 'field' => [ |
e7a6b91a | 580 | 0 => 'title', |
c3fc2621 CW |
581 | ], |
582 | 'localizable' => TRUE, | |
583 | 'unique' => TRUE, | |
e7a6b91a | 584 | 'sig' => 'civicrm_group::1::title', |
c3fc2621 CW |
585 | ], |
586 | 'UI_name' => [ | |
e7a6b91a | 587 | 'name' => 'UI_name', |
c3fc2621 | 588 | 'field' => [ |
e7a6b91a | 589 | 0 => 'name', |
c3fc2621 CW |
590 | ], |
591 | 'localizable' => FALSE, | |
592 | 'unique' => TRUE, | |
e7a6b91a | 593 | 'sig' => 'civicrm_group::1::name', |
c3fc2621 CW |
594 | ], |
595 | ]; | |
e7a6b91a AS |
596 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
597 | } | |
c3fc2621 | 598 | |
e501603b | 599 | } |