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