3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2015
31 * Generated from xml/schema/CRM/ACL/ACL.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_ACL_DAO_ACL
extends CRM_Core_DAO
{
38 * static instance to hold the table name
42 static $_tableName = 'civicrm_acl';
44 * static instance to hold the field values
48 static $_fields = null;
50 * static instance to hold the keys used in $_fields for each field.
54 static $_fieldKeys = null;
56 * static instance to hold the FK relationships
60 static $_links = null;
62 * static instance to hold the values that can
67 static $_import = null;
69 * static instance to hold the values that can
74 static $_export = null;
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
95 * Is this ACL entry Allow (0) or Deny (1) ?
101 * Table of the object possessing this ACL entry (Contact, Group, or ACL Group)
105 public $entity_table;
107 * ID of the object possessing this ACL
113 * What operation does this ACL entry control?
119 * The table of the object controlled by this ACL entry
123 public $object_table;
125 * The ID of the object controlled by this ACL entry
131 * If this is a grant/revoke entry, what table are we granting?
137 * ID of the ACL or ACL group being granted/revoked
143 * Is this property active?
151 * @return civicrm_acl
153 function __construct() {
154 $this->__table
= 'civicrm_acl';
155 parent
::__construct();
158 * Returns foreign keys and entity references
161 * [CRM_Core_Reference_Interface]
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');
168 return self
::$_links;
171 * Returns all the column names of this table
175 static function &fields() {
176 if (!(self
::$_fields)) {
177 self
::$_fields = array(
180 'type' => CRM_Utils_Type
::T_INT
,
181 'title' => ts('ACL ID') ,
182 'description' => 'Unique table ID',
187 'type' => CRM_Utils_Type
::T_STRING
,
188 'title' => ts('ACL Name') ,
189 'description' => 'ACL Name.',
191 'size' => CRM_Utils_Type
::BIG
,
198 'type' => CRM_Utils_Type
::T_BOOLEAN
,
199 'title' => ts('Deny ACL?') ,
200 'description' => 'Is this ACL entry Allow (0) or Deny (1) ?',
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)',
213 'size' => CRM_Utils_Type
::BIG
,
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',
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?',
228 'size' => CRM_Utils_Type
::EIGHT
,
232 'pseudoconstant' => array(
233 'callback' => 'CRM_ACL_BAO_ACL::operation',
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',
242 'size' => CRM_Utils_Type
::BIG
,
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',
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?',
256 'size' => CRM_Utils_Type
::BIG
,
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',
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?',
270 'type' => 'Checkbox',
275 return self
::$_fields;
278 * Returns an array containing, for each field, the arary key used for that
279 * field in self::$_fields.
283 static function &fieldKeys() {
284 if (!(self
::$_fieldKeys)) {
285 self
::$_fieldKeys = array(
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',
299 return self
::$_fieldKeys;
302 * Returns the names of this table
306 static function getTableName() {
307 return self
::$_tableName;
310 * Returns if this table needs to be logged
318 * Returns the list of fields that can be imported
320 * @param bool $prefix
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)) {
331 self
::$_import['acl'] = & $fields[$name];
333 self
::$_import[$name] = & $fields[$name];
338 return self
::$_import;
341 * Returns the list of fields that can be exported
343 * @param bool $prefix
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)) {
354 self
::$_export['acl'] = & $fields[$name];
356 self
::$_export[$name] = & $fields[$name];
361 return self
::$_export;