5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/ACL/ACL.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:d91adfb9ffb0a514d42f6828f1b95033)
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 public static $_tableName = 'civicrm_acl';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
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 localized title of this entity.
119 public static function getEntityTitle() {
124 * Returns foreign keys and entity references.
127 * [CRM_Core_Reference_Interface]
129 public static function getReferenceColumns() {
130 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
131 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
132 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
133 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
135 return Civi
::$statics[__CLASS__
]['links'];
139 * Returns all the column names of this table
143 public static function &fields() {
144 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
145 Civi
::$statics[__CLASS__
]['fields'] = [
148 'type' => CRM_Utils_Type
::T_INT
,
149 'title' => ts('ACL ID'),
150 'description' => ts('Unique table ID'),
152 'where' => 'civicrm_acl.id',
153 'table_name' => 'civicrm_acl',
155 'bao' => 'CRM_ACL_BAO_ACL',
161 'type' => CRM_Utils_Type
::T_STRING
,
162 'title' => ts('ACL Name'),
163 'description' => ts('ACL Name.'),
165 'size' => CRM_Utils_Type
::BIG
,
166 'where' => 'civicrm_acl.name',
167 'table_name' => 'civicrm_acl',
169 'bao' => 'CRM_ACL_BAO_ACL',
178 'type' => CRM_Utils_Type
::T_BOOLEAN
,
179 'title' => ts('Deny ACL?'),
180 'description' => ts('Is this ACL entry Allow (0) or Deny (1) ?'),
182 'where' => 'civicrm_acl.deny',
184 'table_name' => 'civicrm_acl',
186 'bao' => 'CRM_ACL_BAO_ACL',
194 'name' => 'entity_table',
195 'type' => CRM_Utils_Type
::T_STRING
,
196 'title' => ts('ACL Entity'),
197 'description' => ts('Table of the object possessing this ACL entry (Contact, Group, or ACL Group)'),
200 'size' => CRM_Utils_Type
::BIG
,
201 'where' => 'civicrm_acl.entity_table',
202 'table_name' => 'civicrm_acl',
204 'bao' => 'CRM_ACL_BAO_ACL',
209 'name' => 'entity_id',
210 'type' => CRM_Utils_Type
::T_INT
,
211 'title' => ts('Entity ID'),
212 'description' => ts('ID of the object possessing this ACL'),
213 'where' => 'civicrm_acl.entity_id',
214 'table_name' => 'civicrm_acl',
216 'bao' => 'CRM_ACL_BAO_ACL',
221 'name' => 'operation',
222 'type' => CRM_Utils_Type
::T_STRING
,
223 'title' => ts('ACL Operation'),
224 'description' => ts('What operation does this ACL entry control?'),
227 'size' => CRM_Utils_Type
::EIGHT
,
228 'where' => 'civicrm_acl.operation',
229 'table_name' => 'civicrm_acl',
231 'bao' => 'CRM_ACL_BAO_ACL',
236 'pseudoconstant' => [
237 'callback' => 'CRM_ACL_BAO_ACL::operation',
242 'name' => 'object_table',
243 'type' => CRM_Utils_Type
::T_STRING
,
244 'title' => ts('ACL Object'),
245 'description' => ts('The table of the object controlled by this ACL entry'),
247 'size' => CRM_Utils_Type
::BIG
,
248 'where' => 'civicrm_acl.object_table',
249 'table_name' => 'civicrm_acl',
251 'bao' => 'CRM_ACL_BAO_ACL',
256 'name' => 'object_id',
257 'type' => CRM_Utils_Type
::T_INT
,
258 'title' => ts('ACL Object ID'),
259 'description' => ts('The ID of the object controlled by this ACL entry'),
260 'where' => 'civicrm_acl.object_id',
261 'table_name' => 'civicrm_acl',
263 'bao' => 'CRM_ACL_BAO_ACL',
268 'name' => 'acl_table',
269 'type' => CRM_Utils_Type
::T_STRING
,
270 'title' => ts('ACL Table'),
271 'description' => ts('If this is a grant/revoke entry, what table are we granting?'),
273 'size' => CRM_Utils_Type
::BIG
,
274 'where' => 'civicrm_acl.acl_table',
275 'table_name' => 'civicrm_acl',
277 'bao' => 'CRM_ACL_BAO_ACL',
283 'type' => CRM_Utils_Type
::T_INT
,
284 'title' => ts('ACL Group ID'),
285 'description' => ts('ID of the ACL or ACL group being granted/revoked'),
286 'where' => 'civicrm_acl.acl_id',
287 'table_name' => 'civicrm_acl',
289 'bao' => 'CRM_ACL_BAO_ACL',
294 'name' => 'is_active',
295 'type' => CRM_Utils_Type
::T_BOOLEAN
,
296 'title' => ts('ACL Is Active?'),
297 'description' => ts('Is this property active?'),
298 'where' => 'civicrm_acl.is_active',
299 'table_name' => 'civicrm_acl',
301 'bao' => 'CRM_ACL_BAO_ACL',
304 'type' => 'CheckBox',
309 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
311 return Civi
::$statics[__CLASS__
]['fields'];
315 * Return a mapping from field-name to the corresponding key (as used in fields()).
318 * Array(string $name => string $uniqueName).
320 public static function &fieldKeys() {
321 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
322 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
324 return Civi
::$statics[__CLASS__
]['fieldKeys'];
328 * Returns the names of this table
332 public static function getTableName() {
333 return self
::$_tableName;
337 * Returns if this table needs to be logged
341 public function getLog() {
346 * Returns the list of fields that can be imported
348 * @param bool $prefix
352 public static function &import($prefix = FALSE) {
353 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl', $prefix, []);
358 * Returns the list of fields that can be exported
360 * @param bool $prefix
364 public static function &export($prefix = FALSE) {
365 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl', $prefix, []);
370 * Returns the list of indices
372 * @param bool $localize
376 public static function indices($localize = TRUE) {
379 'name' => 'index_acl_id',
383 'localizable' => FALSE,
384 'sig' => 'civicrm_acl::0::acl_id',
387 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;