Commit | Line | Data |
---|---|---|
7f254ad8 AE |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | CiviCRM version 4.6 | | |
5 | +--------------------------------------------------------------------+ | |
6 | | Copyright CiviCRM LLC (c) 2004-2015 | | |
7 | +--------------------------------------------------------------------+ | |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
10 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
11 | | under the terms of the GNU Affero General Public License | | |
12 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
13 | | | | |
14 | | CiviCRM is distributed in the hope that it will be useful, but | | |
15 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
17 | | See the GNU Affero General Public License for more details. | | |
18 | | | | |
19 | | You should have received a copy of the GNU Affero General Public | | |
20 | | License and the CiviCRM Licensing Exception along | | |
21 | | with this program; if not, contact CiviCRM LLC | | |
22 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
23 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
24 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
25 | +--------------------------------------------------------------------+ | |
26 | */ | |
27 | /** | |
28 | * @package CRM | |
29 | * @copyright CiviCRM LLC (c) 2004-2015 | |
30 | * | |
31 | * Generated from xml/schema/CRM/ACL/ACL.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
33 | */ | |
34 | require_once 'CRM/Core/DAO.php'; | |
35 | require_once 'CRM/Utils/Type.php'; | |
36 | class CRM_ACL_DAO_ACL extends CRM_Core_DAO { | |
37 | /** | |
38 | * static instance to hold the table name | |
39 | * | |
40 | * @var string | |
41 | */ | |
42 | static $_tableName = 'civicrm_acl'; | |
43 | /** | |
44 | * static instance to hold the field values | |
45 | * | |
46 | * @var array | |
47 | */ | |
48 | static $_fields = null; | |
49 | /** | |
50 | * static instance to hold the keys used in $_fields for each field. | |
51 | * | |
52 | * @var array | |
53 | */ | |
54 | static $_fieldKeys = null; | |
55 | /** | |
56 | * static instance to hold the FK relationships | |
57 | * | |
58 | * @var string | |
59 | */ | |
60 | static $_links = null; | |
61 | /** | |
62 | * static instance to hold the values that can | |
63 | * be imported | |
64 | * | |
65 | * @var array | |
66 | */ | |
67 | static $_import = null; | |
68 | /** | |
69 | * static instance to hold the values that can | |
70 | * be exported | |
71 | * | |
72 | * @var array | |
73 | */ | |
74 | static $_export = null; | |
75 | /** | |
76 | * static value to see if we should log any modifications to | |
77 | * this table in the civicrm_log table | |
78 | * | |
79 | * @var boolean | |
80 | */ | |
81 | static $_log = false; | |
82 | /** | |
83 | * Unique table ID | |
84 | * | |
85 | * @var int unsigned | |
86 | */ | |
87 | public $id; | |
88 | /** | |
89 | * ACL Name. | |
90 | * | |
91 | * @var string | |
92 | */ | |
93 | public $name; | |
94 | /** | |
95 | * Is this ACL entry Allow (0) or Deny (1) ? | |
96 | * | |
97 | * @var boolean | |
98 | */ | |
99 | public $deny; | |
100 | /** | |
101 | * Table of the object possessing this ACL entry (Contact, Group, or ACL Group) | |
102 | * | |
103 | * @var string | |
104 | */ | |
105 | public $entity_table; | |
106 | /** | |
107 | * ID of the object possessing this ACL | |
108 | * | |
109 | * @var int unsigned | |
110 | */ | |
111 | public $entity_id; | |
112 | /** | |
113 | * What operation does this ACL entry control? | |
114 | * | |
115 | * @var string | |
116 | */ | |
117 | public $operation; | |
118 | /** | |
119 | * The table of the object controlled by this ACL entry | |
120 | * | |
121 | * @var string | |
122 | */ | |
123 | public $object_table; | |
124 | /** | |
125 | * The ID of the object controlled by this ACL entry | |
126 | * | |
127 | * @var int unsigned | |
128 | */ | |
129 | public $object_id; | |
130 | /** | |
131 | * If this is a grant/revoke entry, what table are we granting? | |
132 | * | |
133 | * @var string | |
134 | */ | |
135 | public $acl_table; | |
136 | /** | |
137 | * ID of the ACL or ACL group being granted/revoked | |
138 | * | |
139 | * @var int unsigned | |
140 | */ | |
141 | public $acl_id; | |
142 | /** | |
143 | * Is this property active? | |
144 | * | |
145 | * @var boolean | |
146 | */ | |
147 | public $is_active; | |
148 | /** | |
149 | * class constructor | |
150 | * | |
151 | * @return civicrm_acl | |
152 | */ | |
153 | function __construct() { | |
154 | $this->__table = 'civicrm_acl'; | |
155 | parent::__construct(); | |
156 | } | |
157 | /** | |
158 | * Returns foreign keys and entity references | |
159 | * | |
160 | * @return array | |
161 | * [CRM_Core_Reference_Interface] | |
162 | */ | |
163 | static function getReferenceColumns() { | |
164 | if (!self::$_links) { | |
165 | self::$_links = static ::createReferenceColumns(__CLASS__); | |
166 | self::$_links[] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'entity_id', NULL, 'id', 'entity_table'); | |
167 | } | |
168 | return self::$_links; | |
169 | } | |
170 | /** | |
171 | * Returns all the column names of this table | |
172 | * | |
173 | * @return array | |
174 | */ | |
175 | static function &fields() { | |
176 | if (!(self::$_fields)) { | |
177 | self::$_fields = array( | |
178 | 'id' => array( | |
179 | 'name' => 'id', | |
180 | 'type' => CRM_Utils_Type::T_INT, | |
181 | 'title' => ts('ACL ID') , | |
182 | 'description' => 'Unique table ID', | |
183 | 'required' => true, | |
184 | ) , | |
185 | 'name' => array( | |
186 | 'name' => 'name', | |
187 | 'type' => CRM_Utils_Type::T_STRING, | |
188 | 'title' => ts('ACL Name') , | |
189 | 'description' => 'ACL Name.', | |
190 | 'maxlength' => 64, | |
191 | 'size' => CRM_Utils_Type::BIG, | |
192 | 'html' => array( | |
193 | 'type' => 'Text', | |
194 | ) , | |
195 | ) , | |
196 | 'deny' => array( | |
197 | 'name' => 'deny', | |
198 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
199 | 'title' => ts('Deny ACL?') , | |
200 | 'description' => 'Is this ACL entry Allow (0) or Deny (1) ?', | |
201 | 'required' => true, | |
202 | 'html' => array( | |
203 | 'type' => 'Radio', | |
204 | ) , | |
205 | ) , | |
206 | 'entity_table' => array( | |
207 | 'name' => 'entity_table', | |
208 | 'type' => CRM_Utils_Type::T_STRING, | |
209 | 'title' => ts('ACL Entity') , | |
210 | 'description' => 'Table of the object possessing this ACL entry (Contact, Group, or ACL Group)', | |
211 | 'required' => true, | |
212 | 'maxlength' => 64, | |
213 | 'size' => CRM_Utils_Type::BIG, | |
214 | ) , | |
215 | 'entity_id' => array( | |
216 | 'name' => 'entity_id', | |
217 | 'type' => CRM_Utils_Type::T_INT, | |
218 | 'title' => ts('Entity ID') , | |
219 | 'description' => 'ID of the object possessing this ACL', | |
220 | ) , | |
221 | 'operation' => array( | |
222 | 'name' => 'operation', | |
223 | 'type' => CRM_Utils_Type::T_STRING, | |
224 | 'title' => ts('ACL Operation') , | |
225 | 'description' => 'What operation does this ACL entry control?', | |
226 | 'required' => true, | |
227 | 'maxlength' => 8, | |
228 | 'size' => CRM_Utils_Type::EIGHT, | |
229 | 'html' => array( | |
230 | 'type' => 'Select', | |
231 | ) , | |
232 | 'pseudoconstant' => array( | |
233 | 'callback' => 'CRM_ACL_BAO_ACL::operation', | |
234 | ) | |
235 | ) , | |
236 | 'object_table' => array( | |
237 | 'name' => 'object_table', | |
238 | 'type' => CRM_Utils_Type::T_STRING, | |
239 | 'title' => ts('ACL Object') , | |
240 | 'description' => 'The table of the object controlled by this ACL entry', | |
241 | 'maxlength' => 64, | |
242 | 'size' => CRM_Utils_Type::BIG, | |
243 | ) , | |
244 | 'object_id' => array( | |
245 | 'name' => 'object_id', | |
246 | 'type' => CRM_Utils_Type::T_INT, | |
247 | 'title' => ts('ACL Object ID') , | |
248 | 'description' => 'The ID of the object controlled by this ACL entry', | |
249 | ) , | |
250 | 'acl_table' => array( | |
251 | 'name' => 'acl_table', | |
252 | 'type' => CRM_Utils_Type::T_STRING, | |
253 | 'title' => ts('ACL Table') , | |
254 | 'description' => 'If this is a grant/revoke entry, what table are we granting?', | |
255 | 'maxlength' => 64, | |
256 | 'size' => CRM_Utils_Type::BIG, | |
257 | ) , | |
258 | 'acl_id' => array( | |
259 | 'name' => 'acl_id', | |
260 | 'type' => CRM_Utils_Type::T_INT, | |
261 | 'title' => ts('ACL Group ID') , | |
262 | 'description' => 'ID of the ACL or ACL group being granted/revoked', | |
263 | ) , | |
264 | 'is_active' => array( | |
265 | 'name' => 'is_active', | |
266 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
267 | 'title' => ts('ACL Is Active?') , | |
268 | 'description' => 'Is this property active?', | |
269 | 'html' => array( | |
270 | 'type' => 'Checkbox', | |
271 | ) , | |
272 | ) , | |
273 | ); | |
274 | } | |
275 | return self::$_fields; | |
276 | } | |
277 | /** | |
278 | * Returns an array containing, for each field, the arary key used for that | |
279 | * field in self::$_fields. | |
280 | * | |
281 | * @return array | |
282 | */ | |
283 | static function &fieldKeys() { | |
284 | if (!(self::$_fieldKeys)) { | |
285 | self::$_fieldKeys = array( | |
286 | 'id' => 'id', | |
287 | 'name' => 'name', | |
288 | 'deny' => 'deny', | |
289 | 'entity_table' => 'entity_table', | |
290 | 'entity_id' => 'entity_id', | |
291 | 'operation' => 'operation', | |
292 | 'object_table' => 'object_table', | |
293 | 'object_id' => 'object_id', | |
294 | 'acl_table' => 'acl_table', | |
295 | 'acl_id' => 'acl_id', | |
296 | 'is_active' => 'is_active', | |
297 | ); | |
298 | } | |
299 | return self::$_fieldKeys; | |
300 | } | |
301 | /** | |
302 | * Returns the names of this table | |
303 | * | |
304 | * @return string | |
305 | */ | |
306 | static function getTableName() { | |
307 | return self::$_tableName; | |
308 | } | |
309 | /** | |
310 | * Returns if this table needs to be logged | |
311 | * | |
312 | * @return boolean | |
313 | */ | |
314 | function getLog() { | |
315 | return self::$_log; | |
316 | } | |
317 | /** | |
318 | * Returns the list of fields that can be imported | |
319 | * | |
320 | * @param bool $prefix | |
321 | * | |
322 | * @return array | |
323 | */ | |
324 | static function &import($prefix = false) { | |
325 | if (!(self::$_import)) { | |
326 | self::$_import = array(); | |
327 | $fields = self::fields(); | |
328 | foreach($fields as $name => $field) { | |
329 | if (CRM_Utils_Array::value('import', $field)) { | |
330 | if ($prefix) { | |
331 | self::$_import['acl'] = & $fields[$name]; | |
332 | } else { | |
333 | self::$_import[$name] = & $fields[$name]; | |
334 | } | |
335 | } | |
336 | } | |
337 | } | |
338 | return self::$_import; | |
339 | } | |
340 | /** | |
341 | * Returns the list of fields that can be exported | |
342 | * | |
343 | * @param bool $prefix | |
344 | * | |
345 | * @return array | |
346 | */ | |
347 | static function &export($prefix = false) { | |
348 | if (!(self::$_export)) { | |
349 | self::$_export = array(); | |
350 | $fields = self::fields(); | |
351 | foreach($fields as $name => $field) { | |
352 | if (CRM_Utils_Array::value('export', $field)) { | |
353 | if ($prefix) { | |
354 | self::$_export['acl'] = & $fields[$name]; | |
355 | } else { | |
356 | self::$_export[$name] = & $fields[$name]; | |
357 | } | |
358 | } | |
359 | } | |
360 | } | |
361 | return self::$_export; | |
362 | } | |
363 | } |