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:5245f10c478c4187d1fb420e76f2fd76)
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;
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
46 * (SQL type: varchar(64))
47 * Note that values will be retrieved from the database as a string.
52 * Is this ACL entry Allow (0) or Deny (1) ?
56 * Note that values will be retrieved from the database as a string.
61 * Table of the object possessing this ACL entry (Contact, Group, or ACL Group)
64 * (SQL type: varchar(64))
65 * Note that values will be retrieved from the database as a string.
70 * ID of the object possessing this ACL
72 * @var int|string|null
73 * (SQL type: int unsigned)
74 * Note that values will be retrieved from the database as a string.
79 * What operation does this ACL entry control?
82 * (SQL type: varchar(8))
83 * Note that values will be retrieved from the database as a string.
88 * The table of the object controlled by this ACL entry
91 * (SQL type: varchar(64))
92 * Note that values will be retrieved from the database as a string.
97 * The ID of the object controlled by this ACL entry
99 * @var int|string|null
100 * (SQL type: int unsigned)
101 * Note that values will be retrieved from the database as a string.
106 * If this is a grant/revoke entry, what table are we granting?
109 * (SQL type: varchar(64))
110 * Note that values will be retrieved from the database as a string.
115 * ID of the ACL or ACL group being granted/revoked
117 * @var int|string|null
118 * (SQL type: int unsigned)
119 * Note that values will be retrieved from the database as a string.
124 * Is this property active?
126 * @var bool|string|null
127 * (SQL type: tinyint)
128 * Note that values will be retrieved from the database as a string.
135 public function __construct() {
136 $this->__table
= 'civicrm_acl';
137 parent
::__construct();
141 * Returns localized title of this entity.
143 * @param bool $plural
144 * Whether to return the plural version of the title.
146 public static function getEntityTitle($plural = FALSE) {
147 return $plural ?
ts('ACLs') : ts('ACL');
151 * Returns foreign keys and entity references.
154 * [CRM_Core_Reference_Interface]
156 public static function getReferenceColumns() {
157 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
158 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
159 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
160 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
162 return Civi
::$statics[__CLASS__
]['links'];
166 * Returns all the column names of this table
170 public static function &fields() {
171 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
172 Civi
::$statics[__CLASS__
]['fields'] = [
175 'type' => CRM_Utils_Type
::T_INT
,
176 'title' => ts('ACL ID'),
177 'description' => ts('Unique table ID'),
179 'where' => 'civicrm_acl.id',
180 'table_name' => 'civicrm_acl',
182 'bao' => 'CRM_ACL_BAO_ACL',
192 'type' => CRM_Utils_Type
::T_STRING
,
193 'title' => ts('ACL Name'),
194 'description' => ts('ACL Name.'),
196 'size' => CRM_Utils_Type
::BIG
,
197 'where' => 'civicrm_acl.name',
198 'table_name' => 'civicrm_acl',
200 'bao' => 'CRM_ACL_BAO_ACL',
209 'type' => CRM_Utils_Type
::T_BOOLEAN
,
210 'title' => ts('Deny ACL?'),
211 'description' => ts('Is this ACL entry Allow (0) or Deny (1) ?'),
213 'where' => 'civicrm_acl.deny',
215 'table_name' => 'civicrm_acl',
217 'bao' => 'CRM_ACL_BAO_ACL',
225 'name' => 'entity_table',
226 'type' => CRM_Utils_Type
::T_STRING
,
227 'title' => ts('ACL Entity'),
228 'description' => ts('Table of the object possessing this ACL entry (Contact, Group, or ACL Group)'),
231 'size' => CRM_Utils_Type
::BIG
,
232 'where' => 'civicrm_acl.entity_table',
233 'table_name' => 'civicrm_acl',
235 'bao' => 'CRM_ACL_BAO_ACL',
240 'name' => 'entity_id',
241 'type' => CRM_Utils_Type
::T_INT
,
242 'title' => ts('Entity ID'),
243 'description' => ts('ID of the object possessing this ACL'),
244 'where' => 'civicrm_acl.entity_id',
245 'table_name' => 'civicrm_acl',
247 'bao' => 'CRM_ACL_BAO_ACL',
252 'name' => 'operation',
253 'type' => CRM_Utils_Type
::T_STRING
,
254 'title' => ts('ACL Operation'),
255 'description' => ts('What operation does this ACL entry control?'),
258 'size' => CRM_Utils_Type
::EIGHT
,
259 'where' => 'civicrm_acl.operation',
260 'table_name' => 'civicrm_acl',
262 'bao' => 'CRM_ACL_BAO_ACL',
267 'pseudoconstant' => [
268 'callback' => 'CRM_ACL_BAO_ACL::operation',
273 'name' => 'object_table',
274 'type' => CRM_Utils_Type
::T_STRING
,
275 'title' => ts('ACL Object'),
276 'description' => ts('The table of the object controlled by this ACL entry'),
278 'size' => CRM_Utils_Type
::BIG
,
279 'where' => 'civicrm_acl.object_table',
280 'table_name' => 'civicrm_acl',
282 'bao' => 'CRM_ACL_BAO_ACL',
287 'name' => 'object_id',
288 'type' => CRM_Utils_Type
::T_INT
,
289 'title' => ts('ACL Object ID'),
290 'description' => ts('The ID of the object controlled by this ACL entry'),
291 'where' => 'civicrm_acl.object_id',
292 'table_name' => 'civicrm_acl',
294 'bao' => 'CRM_ACL_BAO_ACL',
299 'name' => 'acl_table',
300 'type' => CRM_Utils_Type
::T_STRING
,
301 'title' => ts('ACL Table'),
302 'description' => ts('If this is a grant/revoke entry, what table are we granting?'),
304 'size' => CRM_Utils_Type
::BIG
,
305 'where' => 'civicrm_acl.acl_table',
306 'table_name' => 'civicrm_acl',
308 'bao' => 'CRM_ACL_BAO_ACL',
314 'type' => CRM_Utils_Type
::T_INT
,
315 'title' => ts('ACL Group ID'),
316 'description' => ts('ID of the ACL or ACL group being granted/revoked'),
317 'where' => 'civicrm_acl.acl_id',
318 'table_name' => 'civicrm_acl',
320 'bao' => 'CRM_ACL_BAO_ACL',
325 'name' => 'is_active',
326 'type' => CRM_Utils_Type
::T_BOOLEAN
,
327 'title' => ts('ACL Is Active?'),
328 'description' => ts('Is this property active?'),
329 'where' => 'civicrm_acl.is_active',
330 'table_name' => 'civicrm_acl',
332 'bao' => 'CRM_ACL_BAO_ACL',
335 'type' => 'CheckBox',
340 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
342 return Civi
::$statics[__CLASS__
]['fields'];
346 * Return a mapping from field-name to the corresponding key (as used in fields()).
349 * Array(string $name => string $uniqueName).
351 public static function &fieldKeys() {
352 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
353 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
355 return Civi
::$statics[__CLASS__
]['fieldKeys'];
359 * Returns the names of this table
363 public static function getTableName() {
364 return self
::$_tableName;
368 * Returns if this table needs to be logged
372 public function getLog() {
377 * Returns the list of fields that can be imported
379 * @param bool $prefix
383 public static function &import($prefix = FALSE) {
384 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl', $prefix, []);
389 * Returns the list of fields that can be exported
391 * @param bool $prefix
395 public static function &export($prefix = FALSE) {
396 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl', $prefix, []);
401 * Returns the list of indices
403 * @param bool $localize
407 public static function indices($localize = TRUE) {
410 'name' => 'index_acl_id',
414 'localizable' => FALSE,
415 'sig' => 'civicrm_acl::0::acl_id',
418 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;