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:54e8c75c28c9dd74192f60bbcf1605f6)
13 * Database access object for the ACL entity.
15 class CRM_ACL_DAO_ACL
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.6';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_acl';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
48 * Is this ACL entry Allow (0) or Deny (1) ?
55 * Table of the object possessing this ACL entry (Contact, Group, or ACL Group)
62 * ID of the object possessing this ACL
69 * What operation does this ACL entry control?
76 * The table of the object controlled by this ACL entry
83 * The ID of the object controlled by this ACL entry
90 * If this is a grant/revoke entry, what table are we granting?
97 * ID of the ACL or ACL group being granted/revoked
104 * Is this property active?
113 public function __construct() {
114 $this->__table
= 'civicrm_acl';
115 parent
::__construct();
119 * Returns localized title of this entity.
121 * @param bool $plural
122 * Whether to return the plural version of the title.
124 public static function getEntityTitle($plural = FALSE) {
125 return $plural ?
ts('ACLs') : ts('ACL');
129 * Returns foreign keys and entity references.
132 * [CRM_Core_Reference_Interface]
134 public static function getReferenceColumns() {
135 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
136 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
137 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
138 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
140 return Civi
::$statics[__CLASS__
]['links'];
144 * Returns all the column names of this table
148 public static function &fields() {
149 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
150 Civi
::$statics[__CLASS__
]['fields'] = [
153 'type' => CRM_Utils_Type
::T_INT
,
154 'title' => ts('ACL ID'),
155 'description' => ts('Unique table ID'),
157 'where' => 'civicrm_acl.id',
158 'table_name' => 'civicrm_acl',
160 'bao' => 'CRM_ACL_BAO_ACL',
166 'type' => CRM_Utils_Type
::T_STRING
,
167 'title' => ts('ACL Name'),
168 'description' => ts('ACL Name.'),
170 'size' => CRM_Utils_Type
::BIG
,
171 'where' => 'civicrm_acl.name',
172 'table_name' => 'civicrm_acl',
174 'bao' => 'CRM_ACL_BAO_ACL',
183 'type' => CRM_Utils_Type
::T_BOOLEAN
,
184 'title' => ts('Deny ACL?'),
185 'description' => ts('Is this ACL entry Allow (0) or Deny (1) ?'),
187 'where' => 'civicrm_acl.deny',
189 'table_name' => 'civicrm_acl',
191 'bao' => 'CRM_ACL_BAO_ACL',
199 'name' => 'entity_table',
200 'type' => CRM_Utils_Type
::T_STRING
,
201 'title' => ts('ACL Entity'),
202 'description' => ts('Table of the object possessing this ACL entry (Contact, Group, or ACL Group)'),
205 'size' => CRM_Utils_Type
::BIG
,
206 'where' => 'civicrm_acl.entity_table',
207 'table_name' => 'civicrm_acl',
209 'bao' => 'CRM_ACL_BAO_ACL',
214 'name' => 'entity_id',
215 'type' => CRM_Utils_Type
::T_INT
,
216 'title' => ts('Entity ID'),
217 'description' => ts('ID of the object possessing this ACL'),
218 'where' => 'civicrm_acl.entity_id',
219 'table_name' => 'civicrm_acl',
221 'bao' => 'CRM_ACL_BAO_ACL',
226 'name' => 'operation',
227 'type' => CRM_Utils_Type
::T_STRING
,
228 'title' => ts('ACL Operation'),
229 'description' => ts('What operation does this ACL entry control?'),
232 'size' => CRM_Utils_Type
::EIGHT
,
233 'where' => 'civicrm_acl.operation',
234 'table_name' => 'civicrm_acl',
236 'bao' => 'CRM_ACL_BAO_ACL',
241 'pseudoconstant' => [
242 'callback' => 'CRM_ACL_BAO_ACL::operation',
247 'name' => 'object_table',
248 'type' => CRM_Utils_Type
::T_STRING
,
249 'title' => ts('ACL Object'),
250 'description' => ts('The table of the object controlled by this ACL entry'),
252 'size' => CRM_Utils_Type
::BIG
,
253 'where' => 'civicrm_acl.object_table',
254 'table_name' => 'civicrm_acl',
256 'bao' => 'CRM_ACL_BAO_ACL',
261 'name' => 'object_id',
262 'type' => CRM_Utils_Type
::T_INT
,
263 'title' => ts('ACL Object ID'),
264 'description' => ts('The ID of the object controlled by this ACL entry'),
265 'where' => 'civicrm_acl.object_id',
266 'table_name' => 'civicrm_acl',
268 'bao' => 'CRM_ACL_BAO_ACL',
273 'name' => 'acl_table',
274 'type' => CRM_Utils_Type
::T_STRING
,
275 'title' => ts('ACL Table'),
276 'description' => ts('If this is a grant/revoke entry, what table are we granting?'),
278 'size' => CRM_Utils_Type
::BIG
,
279 'where' => 'civicrm_acl.acl_table',
280 'table_name' => 'civicrm_acl',
282 'bao' => 'CRM_ACL_BAO_ACL',
288 'type' => CRM_Utils_Type
::T_INT
,
289 'title' => ts('ACL Group ID'),
290 'description' => ts('ID of the ACL or ACL group being granted/revoked'),
291 'where' => 'civicrm_acl.acl_id',
292 'table_name' => 'civicrm_acl',
294 'bao' => 'CRM_ACL_BAO_ACL',
299 'name' => 'is_active',
300 'type' => CRM_Utils_Type
::T_BOOLEAN
,
301 'title' => ts('ACL Is Active?'),
302 'description' => ts('Is this property active?'),
303 'where' => 'civicrm_acl.is_active',
304 'table_name' => 'civicrm_acl',
306 'bao' => 'CRM_ACL_BAO_ACL',
309 'type' => 'CheckBox',
314 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
316 return Civi
::$statics[__CLASS__
]['fields'];
320 * Return a mapping from field-name to the corresponding key (as used in fields()).
323 * Array(string $name => string $uniqueName).
325 public static function &fieldKeys() {
326 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
327 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
329 return Civi
::$statics[__CLASS__
]['fieldKeys'];
333 * Returns the names of this table
337 public static function getTableName() {
338 return self
::$_tableName;
342 * Returns if this table needs to be logged
346 public function getLog() {
351 * Returns the list of fields that can be imported
353 * @param bool $prefix
357 public static function &import($prefix = FALSE) {
358 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl', $prefix, []);
363 * Returns the list of fields that can be exported
365 * @param bool $prefix
369 public static function &export($prefix = FALSE) {
370 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl', $prefix, []);
375 * Returns the list of indices
377 * @param bool $localize
381 public static function indices($localize = TRUE) {
384 'name' => 'index_acl_id',
388 'localizable' => FALSE,
389 'sig' => 'civicrm_acl::0::acl_id',
392 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;