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:f75eaa0ee87675c14a224ec22b2c30a7)
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 public static function getEntityTitle() {
126 * Returns foreign keys and entity references.
129 * [CRM_Core_Reference_Interface]
131 public static function getReferenceColumns() {
132 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
133 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
134 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
135 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
137 return Civi
::$statics[__CLASS__
]['links'];
141 * Returns all the column names of this table
145 public static function &fields() {
146 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
147 Civi
::$statics[__CLASS__
]['fields'] = [
150 'type' => CRM_Utils_Type
::T_INT
,
151 'title' => ts('ACL ID'),
152 'description' => ts('Unique table ID'),
154 'where' => 'civicrm_acl.id',
155 'table_name' => 'civicrm_acl',
157 'bao' => 'CRM_ACL_BAO_ACL',
163 'type' => CRM_Utils_Type
::T_STRING
,
164 'title' => ts('ACL Name'),
165 'description' => ts('ACL Name.'),
167 'size' => CRM_Utils_Type
::BIG
,
168 'where' => 'civicrm_acl.name',
169 'table_name' => 'civicrm_acl',
171 'bao' => 'CRM_ACL_BAO_ACL',
180 'type' => CRM_Utils_Type
::T_BOOLEAN
,
181 'title' => ts('Deny ACL?'),
182 'description' => ts('Is this ACL entry Allow (0) or Deny (1) ?'),
184 'where' => 'civicrm_acl.deny',
186 'table_name' => 'civicrm_acl',
188 'bao' => 'CRM_ACL_BAO_ACL',
196 'name' => 'entity_table',
197 'type' => CRM_Utils_Type
::T_STRING
,
198 'title' => ts('ACL Entity'),
199 'description' => ts('Table of the object possessing this ACL entry (Contact, Group, or ACL Group)'),
202 'size' => CRM_Utils_Type
::BIG
,
203 'where' => 'civicrm_acl.entity_table',
204 'table_name' => 'civicrm_acl',
206 'bao' => 'CRM_ACL_BAO_ACL',
211 'name' => 'entity_id',
212 'type' => CRM_Utils_Type
::T_INT
,
213 'title' => ts('Entity ID'),
214 'description' => ts('ID of the object possessing this ACL'),
215 'where' => 'civicrm_acl.entity_id',
216 'table_name' => 'civicrm_acl',
218 'bao' => 'CRM_ACL_BAO_ACL',
223 'name' => 'operation',
224 'type' => CRM_Utils_Type
::T_STRING
,
225 'title' => ts('ACL Operation'),
226 'description' => ts('What operation does this ACL entry control?'),
229 'size' => CRM_Utils_Type
::EIGHT
,
230 'where' => 'civicrm_acl.operation',
231 'table_name' => 'civicrm_acl',
233 'bao' => 'CRM_ACL_BAO_ACL',
238 'pseudoconstant' => [
239 'callback' => 'CRM_ACL_BAO_ACL::operation',
244 'name' => 'object_table',
245 'type' => CRM_Utils_Type
::T_STRING
,
246 'title' => ts('ACL Object'),
247 'description' => ts('The table of the object controlled by this ACL entry'),
249 'size' => CRM_Utils_Type
::BIG
,
250 'where' => 'civicrm_acl.object_table',
251 'table_name' => 'civicrm_acl',
253 'bao' => 'CRM_ACL_BAO_ACL',
258 'name' => 'object_id',
259 'type' => CRM_Utils_Type
::T_INT
,
260 'title' => ts('ACL Object ID'),
261 'description' => ts('The ID of the object controlled by this ACL entry'),
262 'where' => 'civicrm_acl.object_id',
263 'table_name' => 'civicrm_acl',
265 'bao' => 'CRM_ACL_BAO_ACL',
270 'name' => 'acl_table',
271 'type' => CRM_Utils_Type
::T_STRING
,
272 'title' => ts('ACL Table'),
273 'description' => ts('If this is a grant/revoke entry, what table are we granting?'),
275 'size' => CRM_Utils_Type
::BIG
,
276 'where' => 'civicrm_acl.acl_table',
277 'table_name' => 'civicrm_acl',
279 'bao' => 'CRM_ACL_BAO_ACL',
285 'type' => CRM_Utils_Type
::T_INT
,
286 'title' => ts('ACL Group ID'),
287 'description' => ts('ID of the ACL or ACL group being granted/revoked'),
288 'where' => 'civicrm_acl.acl_id',
289 'table_name' => 'civicrm_acl',
291 'bao' => 'CRM_ACL_BAO_ACL',
296 'name' => 'is_active',
297 'type' => CRM_Utils_Type
::T_BOOLEAN
,
298 'title' => ts('ACL Is Active?'),
299 'description' => ts('Is this property active?'),
300 'where' => 'civicrm_acl.is_active',
301 'table_name' => 'civicrm_acl',
303 'bao' => 'CRM_ACL_BAO_ACL',
306 'type' => 'CheckBox',
311 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
313 return Civi
::$statics[__CLASS__
]['fields'];
317 * Return a mapping from field-name to the corresponding key (as used in fields()).
320 * Array(string $name => string $uniqueName).
322 public static function &fieldKeys() {
323 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
324 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
326 return Civi
::$statics[__CLASS__
]['fieldKeys'];
330 * Returns the names of this table
334 public static function getTableName() {
335 return self
::$_tableName;
339 * Returns if this table needs to be logged
343 public function getLog() {
348 * Returns the list of fields that can be imported
350 * @param bool $prefix
354 public static function &import($prefix = FALSE) {
355 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl', $prefix, []);
360 * Returns the list of fields that can be exported
362 * @param bool $prefix
366 public static function &export($prefix = FALSE) {
367 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl', $prefix, []);
372 * Returns the list of indices
374 * @param bool $localize
378 public static function indices($localize = TRUE) {
381 'name' => 'index_acl_id',
385 'localizable' => FALSE,
386 'sig' => 'civicrm_acl::0::acl_id',
389 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;