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