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/ACL/ACL.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
28979d65 | 9 | * (GenCodeChecksum:5245f10c478c4187d1fb420e76f2fd76) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the ACL entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_ACL_DAO_ACL extends CRM_Core_DAO { |
929a1c14 CW |
16 | const EXT = 'civicrm'; |
17 | const TABLE_ADDED = '1.6'; | |
c3fc2621 | 18 | |
e501603b | 19 | /** |
f41f0342 | 20 | * Static instance to hold the table name. |
e501603b TO |
21 | * |
22 | * @var string | |
23 | */ | |
fa45b5b9 | 24 | public static $_tableName = 'civicrm_acl'; |
c3fc2621 | 25 | |
e501603b | 26 | /** |
f41f0342 | 27 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 28 | * |
c3fc2621 | 29 | * @var bool |
e501603b | 30 | */ |
fa45b5b9 | 31 | public static $_log = FALSE; |
c3fc2621 | 32 | |
e501603b TO |
33 | /** |
34 | * Unique table ID | |
35 | * | |
28979d65 CW |
36 | * @var int|string|null |
37 | * (SQL type: int unsigned) | |
38 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
39 | */ |
40 | public $id; | |
c3fc2621 | 41 | |
e501603b TO |
42 | /** |
43 | * ACL Name. | |
44 | * | |
28979d65 CW |
45 | * @var string|null |
46 | * (SQL type: varchar(64)) | |
47 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
48 | */ |
49 | public $name; | |
c3fc2621 | 50 | |
e501603b TO |
51 | /** |
52 | * Is this ACL entry Allow (0) or Deny (1) ? | |
53 | * | |
28979d65 CW |
54 | * @var bool|string |
55 | * (SQL type: tinyint) | |
56 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
57 | */ |
58 | public $deny; | |
c3fc2621 | 59 | |
e501603b TO |
60 | /** |
61 | * Table of the object possessing this ACL entry (Contact, Group, or ACL Group) | |
62 | * | |
63 | * @var string | |
28979d65 CW |
64 | * (SQL type: varchar(64)) |
65 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
66 | */ |
67 | public $entity_table; | |
c3fc2621 | 68 | |
e501603b TO |
69 | /** |
70 | * ID of the object possessing this ACL | |
71 | * | |
28979d65 CW |
72 | * @var int|string|null |
73 | * (SQL type: int unsigned) | |
74 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
75 | */ |
76 | public $entity_id; | |
c3fc2621 | 77 | |
e501603b TO |
78 | /** |
79 | * What operation does this ACL entry control? | |
80 | * | |
81 | * @var string | |
28979d65 CW |
82 | * (SQL type: varchar(8)) |
83 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
84 | */ |
85 | public $operation; | |
c3fc2621 | 86 | |
e501603b TO |
87 | /** |
88 | * The table of the object controlled by this ACL entry | |
89 | * | |
28979d65 CW |
90 | * @var string|null |
91 | * (SQL type: varchar(64)) | |
92 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
93 | */ |
94 | public $object_table; | |
c3fc2621 | 95 | |
e501603b TO |
96 | /** |
97 | * The ID of the object controlled by this ACL entry | |
98 | * | |
28979d65 CW |
99 | * @var int|string|null |
100 | * (SQL type: int unsigned) | |
101 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
102 | */ |
103 | public $object_id; | |
c3fc2621 | 104 | |
e501603b TO |
105 | /** |
106 | * If this is a grant/revoke entry, what table are we granting? | |
107 | * | |
28979d65 CW |
108 | * @var string|null |
109 | * (SQL type: varchar(64)) | |
110 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
111 | */ |
112 | public $acl_table; | |
c3fc2621 | 113 | |
e501603b TO |
114 | /** |
115 | * ID of the ACL or ACL group being granted/revoked | |
116 | * | |
28979d65 CW |
117 | * @var int|string|null |
118 | * (SQL type: int unsigned) | |
119 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
120 | */ |
121 | public $acl_id; | |
c3fc2621 | 122 | |
e501603b TO |
123 | /** |
124 | * Is this property active? | |
125 | * | |
28979d65 CW |
126 | * @var bool|string|null |
127 | * (SQL type: tinyint) | |
128 | * Note that values will be retrieved from the database as a string. | |
e501603b TO |
129 | */ |
130 | public $is_active; | |
c3fc2621 | 131 | |
e501603b | 132 | /** |
f41f0342 | 133 | * Class constructor. |
e501603b | 134 | */ |
c3fc2621 | 135 | public function __construct() { |
e501603b TO |
136 | $this->__table = 'civicrm_acl'; |
137 | parent::__construct(); | |
138 | } | |
c3fc2621 | 139 | |
449c4e6b CW |
140 | /** |
141 | * Returns localized title of this entity. | |
7b66c3b5 AH |
142 | * |
143 | * @param bool $plural | |
144 | * Whether to return the plural version of the title. | |
449c4e6b | 145 | */ |
7b66c3b5 AH |
146 | public static function getEntityTitle($plural = FALSE) { |
147 | return $plural ? ts('ACLs') : ts('ACL'); | |
449c4e6b CW |
148 | } |
149 | ||
e501603b | 150 | /** |
f41f0342 | 151 | * Returns foreign keys and entity references. |
e501603b TO |
152 | * |
153 | * @return array | |
154 | * [CRM_Core_Reference_Interface] | |
155 | */ | |
c3fc2621 | 156 | public static function getReferenceColumns() { |
346aaaba | 157 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
cf0d1c08 | 158 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 | 159 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Dynamic(self::getTableName(), 'entity_id', NULL, 'id', 'entity_table'); |
346aaaba | 160 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 161 | } |
346aaaba | 162 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 163 | } |
c3fc2621 | 164 | |
e501603b TO |
165 | /** |
166 | * Returns all the column names of this table | |
167 | * | |
168 | * @return array | |
169 | */ | |
c3fc2621 | 170 | public static function &fields() { |
346aaaba | 171 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
172 | Civi::$statics[__CLASS__]['fields'] = [ |
173 | 'id' => [ | |
e501603b TO |
174 | 'name' => 'id', |
175 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 176 | 'title' => ts('ACL ID'), |
215b423e | 177 | 'description' => ts('Unique table ID'), |
c3fc2621 | 178 | 'required' => TRUE, |
a36434b9 | 179 | 'where' => 'civicrm_acl.id', |
522a26c9 | 180 | 'table_name' => 'civicrm_acl', |
181 | 'entity' => 'ACL', | |
182 | 'bao' => 'CRM_ACL_BAO_ACL', | |
6a7e5e5d | 183 | 'localizable' => 0, |
2cbbebe8 A |
184 | 'html' => [ |
185 | 'type' => 'Number', | |
186 | ], | |
1fe423d6 | 187 | 'readonly' => TRUE, |
a9d0587b | 188 | 'add' => '1.6', |
c3fc2621 CW |
189 | ], |
190 | 'name' => [ | |
e501603b TO |
191 | 'name' => 'name', |
192 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 193 | 'title' => ts('ACL Name'), |
215b423e | 194 | 'description' => ts('ACL Name.'), |
e501603b TO |
195 | 'maxlength' => 64, |
196 | 'size' => CRM_Utils_Type::BIG, | |
a36434b9 | 197 | 'where' => 'civicrm_acl.name', |
522a26c9 | 198 | 'table_name' => 'civicrm_acl', |
199 | 'entity' => 'ACL', | |
200 | 'bao' => 'CRM_ACL_BAO_ACL', | |
6a7e5e5d | 201 | 'localizable' => 0, |
c3fc2621 | 202 | 'html' => [ |
e501603b | 203 | 'type' => 'Text', |
c3fc2621 | 204 | ], |
a9d0587b | 205 | 'add' => '1.6', |
c3fc2621 CW |
206 | ], |
207 | 'deny' => [ | |
e501603b TO |
208 | 'name' => 'deny', |
209 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 210 | 'title' => ts('Deny ACL?'), |
215b423e | 211 | 'description' => ts('Is this ACL entry Allow (0) or Deny (1) ?'), |
c3fc2621 | 212 | 'required' => TRUE, |
a36434b9 | 213 | 'where' => 'civicrm_acl.deny', |
45a83e42 | 214 | 'default' => '0', |
522a26c9 | 215 | 'table_name' => 'civicrm_acl', |
216 | 'entity' => 'ACL', | |
217 | 'bao' => 'CRM_ACL_BAO_ACL', | |
6a7e5e5d | 218 | 'localizable' => 0, |
c3fc2621 | 219 | 'html' => [ |
e501603b | 220 | 'type' => 'Radio', |
c3fc2621 | 221 | ], |
a9d0587b | 222 | 'add' => '1.6', |
c3fc2621 CW |
223 | ], |
224 | 'entity_table' => [ | |
e501603b TO |
225 | 'name' => 'entity_table', |
226 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 227 | 'title' => ts('ACL Entity'), |
215b423e | 228 | 'description' => ts('Table of the object possessing this ACL entry (Contact, Group, or ACL Group)'), |
c3fc2621 | 229 | 'required' => TRUE, |
e501603b TO |
230 | 'maxlength' => 64, |
231 | 'size' => CRM_Utils_Type::BIG, | |
a36434b9 | 232 | 'where' => 'civicrm_acl.entity_table', |
522a26c9 | 233 | 'table_name' => 'civicrm_acl', |
234 | 'entity' => 'ACL', | |
235 | 'bao' => 'CRM_ACL_BAO_ACL', | |
6a7e5e5d | 236 | 'localizable' => 0, |
a9d0587b | 237 | 'add' => '1.6', |
c3fc2621 CW |
238 | ], |
239 | 'entity_id' => [ | |
e501603b TO |
240 | 'name' => 'entity_id', |
241 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 242 | 'title' => ts('Entity ID'), |
215b423e | 243 | 'description' => ts('ID of the object possessing this ACL'), |
a36434b9 | 244 | 'where' => 'civicrm_acl.entity_id', |
522a26c9 | 245 | 'table_name' => 'civicrm_acl', |
246 | 'entity' => 'ACL', | |
247 | 'bao' => 'CRM_ACL_BAO_ACL', | |
6a7e5e5d | 248 | 'localizable' => 0, |
a9d0587b | 249 | 'add' => '1.6', |
c3fc2621 CW |
250 | ], |
251 | 'operation' => [ | |
e501603b TO |
252 | 'name' => 'operation', |
253 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 254 | 'title' => ts('ACL Operation'), |
215b423e | 255 | 'description' => ts('What operation does this ACL entry control?'), |
c3fc2621 | 256 | 'required' => TRUE, |
e501603b TO |
257 | 'maxlength' => 8, |
258 | 'size' => CRM_Utils_Type::EIGHT, | |
a36434b9 | 259 | 'where' => 'civicrm_acl.operation', |
522a26c9 | 260 | 'table_name' => 'civicrm_acl', |
261 | 'entity' => 'ACL', | |
262 | 'bao' => 'CRM_ACL_BAO_ACL', | |
6a7e5e5d | 263 | 'localizable' => 0, |
c3fc2621 | 264 | 'html' => [ |
e501603b | 265 | 'type' => 'Select', |
c3fc2621 CW |
266 | ], |
267 | 'pseudoconstant' => [ | |
e501603b | 268 | 'callback' => 'CRM_ACL_BAO_ACL::operation', |
800d9240 | 269 | ], |
a9d0587b | 270 | 'add' => '1.6', |
c3fc2621 CW |
271 | ], |
272 | 'object_table' => [ | |
e501603b TO |
273 | 'name' => 'object_table', |
274 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 275 | 'title' => ts('ACL Object'), |
215b423e | 276 | 'description' => ts('The table of the object controlled by this ACL entry'), |
e501603b TO |
277 | 'maxlength' => 64, |
278 | 'size' => CRM_Utils_Type::BIG, | |
a36434b9 | 279 | 'where' => 'civicrm_acl.object_table', |
522a26c9 | 280 | 'table_name' => 'civicrm_acl', |
281 | 'entity' => 'ACL', | |
282 | 'bao' => 'CRM_ACL_BAO_ACL', | |
6a7e5e5d | 283 | 'localizable' => 0, |
a9d0587b | 284 | 'add' => '1.6', |
c3fc2621 CW |
285 | ], |
286 | 'object_id' => [ | |
e501603b TO |
287 | 'name' => 'object_id', |
288 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 289 | 'title' => ts('ACL Object ID'), |
215b423e | 290 | 'description' => ts('The ID of the object controlled by this ACL entry'), |
a36434b9 | 291 | 'where' => 'civicrm_acl.object_id', |
522a26c9 | 292 | 'table_name' => 'civicrm_acl', |
293 | 'entity' => 'ACL', | |
294 | 'bao' => 'CRM_ACL_BAO_ACL', | |
6a7e5e5d | 295 | 'localizable' => 0, |
a9d0587b | 296 | 'add' => '1.6', |
c3fc2621 CW |
297 | ], |
298 | 'acl_table' => [ | |
e501603b TO |
299 | 'name' => 'acl_table', |
300 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 301 | 'title' => ts('ACL Table'), |
215b423e | 302 | 'description' => ts('If this is a grant/revoke entry, what table are we granting?'), |
e501603b TO |
303 | 'maxlength' => 64, |
304 | 'size' => CRM_Utils_Type::BIG, | |
a36434b9 | 305 | 'where' => 'civicrm_acl.acl_table', |
522a26c9 | 306 | 'table_name' => 'civicrm_acl', |
307 | 'entity' => 'ACL', | |
308 | 'bao' => 'CRM_ACL_BAO_ACL', | |
6a7e5e5d | 309 | 'localizable' => 0, |
a9d0587b | 310 | 'add' => '1.6', |
c3fc2621 CW |
311 | ], |
312 | 'acl_id' => [ | |
e501603b TO |
313 | 'name' => 'acl_id', |
314 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 315 | 'title' => ts('ACL Group ID'), |
215b423e | 316 | 'description' => ts('ID of the ACL or ACL group being granted/revoked'), |
a36434b9 | 317 | 'where' => 'civicrm_acl.acl_id', |
522a26c9 | 318 | 'table_name' => 'civicrm_acl', |
319 | 'entity' => 'ACL', | |
320 | 'bao' => 'CRM_ACL_BAO_ACL', | |
6a7e5e5d | 321 | 'localizable' => 0, |
a9d0587b | 322 | 'add' => '1.6', |
c3fc2621 CW |
323 | ], |
324 | 'is_active' => [ | |
e501603b TO |
325 | 'name' => 'is_active', |
326 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 327 | 'title' => ts('ACL Is Active?'), |
215b423e | 328 | 'description' => ts('Is this property active?'), |
a36434b9 | 329 | 'where' => 'civicrm_acl.is_active', |
522a26c9 | 330 | 'table_name' => 'civicrm_acl', |
331 | 'entity' => 'ACL', | |
332 | 'bao' => 'CRM_ACL_BAO_ACL', | |
6a7e5e5d | 333 | 'localizable' => 0, |
c3fc2621 | 334 | 'html' => [ |
a510f6fb | 335 | 'type' => 'CheckBox', |
c3fc2621 | 336 | ], |
a9d0587b | 337 | 'add' => '1.6', |
c3fc2621 CW |
338 | ], |
339 | ]; | |
346aaaba | 340 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 341 | } |
346aaaba | 342 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 343 | } |
c3fc2621 | 344 | |
e501603b | 345 | /** |
bd8e0b14 | 346 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
347 | * |
348 | * @return array | |
bd8e0b14 | 349 | * Array(string $name => string $uniqueName). |
e501603b | 350 | */ |
c3fc2621 | 351 | public static function &fieldKeys() { |
bd8e0b14 TO |
352 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
353 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 354 | } |
bd8e0b14 | 355 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 356 | } |
c3fc2621 | 357 | |
e501603b TO |
358 | /** |
359 | * Returns the names of this table | |
360 | * | |
361 | * @return string | |
362 | */ | |
c3fc2621 | 363 | public static function getTableName() { |
e501603b TO |
364 | return self::$_tableName; |
365 | } | |
c3fc2621 | 366 | |
e501603b TO |
367 | /** |
368 | * Returns if this table needs to be logged | |
369 | * | |
c3fc2621 | 370 | * @return bool |
e501603b | 371 | */ |
c3fc2621 | 372 | public function getLog() { |
e501603b TO |
373 | return self::$_log; |
374 | } | |
c3fc2621 | 375 | |
e501603b TO |
376 | /** |
377 | * Returns the list of fields that can be imported | |
378 | * | |
379 | * @param bool $prefix | |
380 | * | |
381 | * @return array | |
382 | */ | |
c3fc2621 CW |
383 | public static function &import($prefix = FALSE) { |
384 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'acl', $prefix, []); | |
60808919 | 385 | return $r; |
e501603b | 386 | } |
c3fc2621 | 387 | |
e501603b TO |
388 | /** |
389 | * Returns the list of fields that can be exported | |
390 | * | |
391 | * @param bool $prefix | |
392 | * | |
393 | * @return array | |
394 | */ | |
c3fc2621 CW |
395 | public static function &export($prefix = FALSE) { |
396 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'acl', $prefix, []); | |
60808919 | 397 | return $r; |
e501603b | 398 | } |
c3fc2621 | 399 | |
e7a6b91a AS |
400 | /** |
401 | * Returns the list of indices | |
c3fc2621 CW |
402 | * |
403 | * @param bool $localize | |
404 | * | |
405 | * @return array | |
e7a6b91a AS |
406 | */ |
407 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
408 | $indices = [ |
409 | 'index_acl_id' => [ | |
e7a6b91a | 410 | 'name' => 'index_acl_id', |
c3fc2621 | 411 | 'field' => [ |
e7a6b91a | 412 | 0 => 'acl_id', |
c3fc2621 CW |
413 | ], |
414 | 'localizable' => FALSE, | |
e7a6b91a | 415 | 'sig' => 'civicrm_acl::0::acl_id', |
c3fc2621 CW |
416 | ], |
417 | ]; | |
e7a6b91a AS |
418 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
419 | } | |
c3fc2621 | 420 | |
e501603b | 421 | } |