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:709746b9e63da79d9ee75de3a0687db4)
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',
170 'type' => CRM_Utils_Type
::T_STRING
,
171 'title' => ts('ACL Name'),
172 'description' => ts('ACL Name.'),
174 'size' => CRM_Utils_Type
::BIG
,
175 'where' => 'civicrm_acl.name',
176 'table_name' => 'civicrm_acl',
178 'bao' => 'CRM_ACL_BAO_ACL',
187 'type' => CRM_Utils_Type
::T_BOOLEAN
,
188 'title' => ts('Deny ACL?'),
189 'description' => ts('Is this ACL entry Allow (0) or Deny (1) ?'),
191 'where' => 'civicrm_acl.deny',
193 'table_name' => 'civicrm_acl',
195 'bao' => 'CRM_ACL_BAO_ACL',
203 'name' => 'entity_table',
204 'type' => CRM_Utils_Type
::T_STRING
,
205 'title' => ts('ACL Entity'),
206 'description' => ts('Table of the object possessing this ACL entry (Contact, Group, or ACL Group)'),
209 'size' => CRM_Utils_Type
::BIG
,
210 'where' => 'civicrm_acl.entity_table',
211 'table_name' => 'civicrm_acl',
213 'bao' => 'CRM_ACL_BAO_ACL',
218 'name' => 'entity_id',
219 'type' => CRM_Utils_Type
::T_INT
,
220 'title' => ts('Entity ID'),
221 'description' => ts('ID of the object possessing this ACL'),
222 'where' => 'civicrm_acl.entity_id',
223 'table_name' => 'civicrm_acl',
225 'bao' => 'CRM_ACL_BAO_ACL',
230 'name' => 'operation',
231 'type' => CRM_Utils_Type
::T_STRING
,
232 'title' => ts('ACL Operation'),
233 'description' => ts('What operation does this ACL entry control?'),
236 'size' => CRM_Utils_Type
::EIGHT
,
237 'where' => 'civicrm_acl.operation',
238 'table_name' => 'civicrm_acl',
240 'bao' => 'CRM_ACL_BAO_ACL',
245 'pseudoconstant' => [
246 'callback' => 'CRM_ACL_BAO_ACL::operation',
251 'name' => 'object_table',
252 'type' => CRM_Utils_Type
::T_STRING
,
253 'title' => ts('ACL Object'),
254 'description' => ts('The table of the object controlled by this ACL entry'),
256 'size' => CRM_Utils_Type
::BIG
,
257 'where' => 'civicrm_acl.object_table',
258 'table_name' => 'civicrm_acl',
260 'bao' => 'CRM_ACL_BAO_ACL',
265 'name' => 'object_id',
266 'type' => CRM_Utils_Type
::T_INT
,
267 'title' => ts('ACL Object ID'),
268 'description' => ts('The ID of the object controlled by this ACL entry'),
269 'where' => 'civicrm_acl.object_id',
270 'table_name' => 'civicrm_acl',
272 'bao' => 'CRM_ACL_BAO_ACL',
277 'name' => 'acl_table',
278 'type' => CRM_Utils_Type
::T_STRING
,
279 'title' => ts('ACL Table'),
280 'description' => ts('If this is a grant/revoke entry, what table are we granting?'),
282 'size' => CRM_Utils_Type
::BIG
,
283 'where' => 'civicrm_acl.acl_table',
284 'table_name' => 'civicrm_acl',
286 'bao' => 'CRM_ACL_BAO_ACL',
292 'type' => CRM_Utils_Type
::T_INT
,
293 'title' => ts('ACL Group ID'),
294 'description' => ts('ID of the ACL or ACL group being granted/revoked'),
295 'where' => 'civicrm_acl.acl_id',
296 'table_name' => 'civicrm_acl',
298 'bao' => 'CRM_ACL_BAO_ACL',
303 'name' => 'is_active',
304 'type' => CRM_Utils_Type
::T_BOOLEAN
,
305 'title' => ts('ACL Is Active?'),
306 'description' => ts('Is this property active?'),
307 'where' => 'civicrm_acl.is_active',
308 'table_name' => 'civicrm_acl',
310 'bao' => 'CRM_ACL_BAO_ACL',
313 'type' => 'CheckBox',
318 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
320 return Civi
::$statics[__CLASS__
]['fields'];
324 * Return a mapping from field-name to the corresponding key (as used in fields()).
327 * Array(string $name => string $uniqueName).
329 public static function &fieldKeys() {
330 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
331 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
333 return Civi
::$statics[__CLASS__
]['fieldKeys'];
337 * Returns the names of this table
341 public static function getTableName() {
342 return self
::$_tableName;
346 * Returns if this table needs to be logged
350 public function getLog() {
355 * Returns the list of fields that can be imported
357 * @param bool $prefix
361 public static function &import($prefix = FALSE) {
362 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl', $prefix, []);
367 * Returns the list of fields that can be exported
369 * @param bool $prefix
373 public static function &export($prefix = FALSE) {
374 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl', $prefix, []);
379 * Returns the list of indices
381 * @param bool $localize
385 public static function indices($localize = TRUE) {
388 'name' => 'index_acl_id',
392 'localizable' => FALSE,
393 'sig' => 'civicrm_acl::0::acl_id',
396 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;