5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/ACL/ACL.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:f56c9ad63ff247e68abf2c7c70ff65ba)
13 * Database access object for the ACL entity.
15 class CRM_ACL_DAO_ACL
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_acl';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
46 * Is this ACL entry Allow (0) or Deny (1) ?
53 * Table of the object possessing this ACL entry (Contact, Group, or ACL Group)
60 * ID of the object possessing this ACL
67 * What operation does this ACL entry control?
74 * The table of the object controlled by this ACL entry
81 * The ID of the object controlled by this ACL entry
88 * If this is a grant/revoke entry, what table are we granting?
95 * ID of the ACL or ACL group being granted/revoked
102 * Is this property active?
111 public function __construct() {
112 $this->__table
= 'civicrm_acl';
113 parent
::__construct();
117 * Returns foreign keys and entity references.
120 * [CRM_Core_Reference_Interface]
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']);
128 return Civi
::$statics[__CLASS__
]['links'];
132 * Returns all the column names of this table
136 public static function &fields() {
137 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
138 Civi
::$statics[__CLASS__
]['fields'] = [
141 'type' => CRM_Utils_Type
::T_INT
,
142 'title' => ts('ACL ID'),
143 'description' => ts('Unique table ID'),
145 'table_name' => 'civicrm_acl',
147 'bao' => 'CRM_ACL_BAO_ACL',
152 'type' => CRM_Utils_Type
::T_STRING
,
153 'title' => ts('ACL Name'),
154 'description' => ts('ACL Name.'),
156 'size' => CRM_Utils_Type
::BIG
,
157 'table_name' => 'civicrm_acl',
159 'bao' => 'CRM_ACL_BAO_ACL',
167 'type' => CRM_Utils_Type
::T_BOOLEAN
,
168 'title' => ts('Deny ACL?'),
169 'description' => ts('Is this ACL entry Allow (0) or Deny (1) ?'),
172 'table_name' => 'civicrm_acl',
174 'bao' => 'CRM_ACL_BAO_ACL',
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)'),
187 'size' => CRM_Utils_Type
::BIG
,
188 'table_name' => 'civicrm_acl',
190 'bao' => 'CRM_ACL_BAO_ACL',
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',
200 'bao' => 'CRM_ACL_BAO_ACL',
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?'),
210 'size' => CRM_Utils_Type
::EIGHT
,
211 'table_name' => 'civicrm_acl',
213 'bao' => 'CRM_ACL_BAO_ACL',
218 'pseudoconstant' => [
219 'callback' => 'CRM_ACL_BAO_ACL::operation',
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'),
228 'size' => CRM_Utils_Type
::BIG
,
229 'table_name' => 'civicrm_acl',
231 'bao' => 'CRM_ACL_BAO_ACL',
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',
241 'bao' => 'CRM_ACL_BAO_ACL',
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?'),
250 'size' => CRM_Utils_Type
::BIG
,
251 'table_name' => 'civicrm_acl',
253 'bao' => 'CRM_ACL_BAO_ACL',
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',
263 'bao' => 'CRM_ACL_BAO_ACL',
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',
273 'bao' => 'CRM_ACL_BAO_ACL',
276 'type' => 'CheckBox',
280 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
282 return Civi
::$statics[__CLASS__
]['fields'];
286 * Return a mapping from field-name to the corresponding key (as used in fields()).
289 * Array(string $name => string $uniqueName).
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()));
295 return Civi
::$statics[__CLASS__
]['fieldKeys'];
299 * Returns the names of this table
303 public static function getTableName() {
304 return self
::$_tableName;
308 * Returns if this table needs to be logged
312 public function getLog() {
317 * Returns the list of fields that can be imported
319 * @param bool $prefix
323 public static function &import($prefix = FALSE) {
324 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl', $prefix, []);
329 * Returns the list of fields that can be exported
331 * @param bool $prefix
335 public static function &export($prefix = FALSE) {
336 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl', $prefix, []);
341 * Returns the list of indices
343 * @param bool $localize
347 public static function indices($localize = TRUE) {
350 'name' => 'index_acl_id',
354 'localizable' => FALSE,
355 'sig' => 'civicrm_acl::0::acl_id',
358 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;