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:0af7d1843e1f675978451550b843ba68)
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',
160 'type' => CRM_Utils_Type
::T_STRING
,
161 'title' => ts('ACL Name'),
162 'description' => ts('ACL Name.'),
164 'size' => CRM_Utils_Type
::BIG
,
165 'where' => 'civicrm_acl.name',
166 'table_name' => 'civicrm_acl',
168 'bao' => 'CRM_ACL_BAO_ACL',
176 'type' => CRM_Utils_Type
::T_BOOLEAN
,
177 'title' => ts('Deny ACL?'),
178 'description' => ts('Is this ACL entry Allow (0) or Deny (1) ?'),
180 'where' => 'civicrm_acl.deny',
182 'table_name' => 'civicrm_acl',
184 'bao' => 'CRM_ACL_BAO_ACL',
191 'name' => 'entity_table',
192 'type' => CRM_Utils_Type
::T_STRING
,
193 'title' => ts('ACL Entity'),
194 'description' => ts('Table of the object possessing this ACL entry (Contact, Group, or ACL Group)'),
197 'size' => CRM_Utils_Type
::BIG
,
198 'where' => 'civicrm_acl.entity_table',
199 'table_name' => 'civicrm_acl',
201 'bao' => 'CRM_ACL_BAO_ACL',
205 'name' => 'entity_id',
206 'type' => CRM_Utils_Type
::T_INT
,
207 'title' => ts('Entity ID'),
208 'description' => ts('ID of the object possessing this ACL'),
209 'where' => 'civicrm_acl.entity_id',
210 'table_name' => 'civicrm_acl',
212 'bao' => 'CRM_ACL_BAO_ACL',
216 'name' => 'operation',
217 'type' => CRM_Utils_Type
::T_STRING
,
218 'title' => ts('ACL Operation'),
219 'description' => ts('What operation does this ACL entry control?'),
222 'size' => CRM_Utils_Type
::EIGHT
,
223 'where' => 'civicrm_acl.operation',
224 'table_name' => 'civicrm_acl',
226 'bao' => 'CRM_ACL_BAO_ACL',
231 'pseudoconstant' => [
232 'callback' => 'CRM_ACL_BAO_ACL::operation',
236 'name' => 'object_table',
237 'type' => CRM_Utils_Type
::T_STRING
,
238 'title' => ts('ACL Object'),
239 'description' => ts('The table of the object controlled by this ACL entry'),
241 'size' => CRM_Utils_Type
::BIG
,
242 'where' => 'civicrm_acl.object_table',
243 'table_name' => 'civicrm_acl',
245 'bao' => 'CRM_ACL_BAO_ACL',
249 'name' => 'object_id',
250 'type' => CRM_Utils_Type
::T_INT
,
251 'title' => ts('ACL Object ID'),
252 'description' => ts('The ID of the object controlled by this ACL entry'),
253 'where' => 'civicrm_acl.object_id',
254 'table_name' => 'civicrm_acl',
256 'bao' => 'CRM_ACL_BAO_ACL',
260 'name' => 'acl_table',
261 'type' => CRM_Utils_Type
::T_STRING
,
262 'title' => ts('ACL Table'),
263 'description' => ts('If this is a grant/revoke entry, what table are we granting?'),
265 'size' => CRM_Utils_Type
::BIG
,
266 'where' => 'civicrm_acl.acl_table',
267 'table_name' => 'civicrm_acl',
269 'bao' => 'CRM_ACL_BAO_ACL',
274 'type' => CRM_Utils_Type
::T_INT
,
275 'title' => ts('ACL Group ID'),
276 'description' => ts('ID of the ACL or ACL group being granted/revoked'),
277 'where' => 'civicrm_acl.acl_id',
278 'table_name' => 'civicrm_acl',
280 'bao' => 'CRM_ACL_BAO_ACL',
284 'name' => 'is_active',
285 'type' => CRM_Utils_Type
::T_BOOLEAN
,
286 'title' => ts('ACL Is Active?'),
287 'description' => ts('Is this property active?'),
288 'where' => 'civicrm_acl.is_active',
289 'table_name' => 'civicrm_acl',
291 'bao' => 'CRM_ACL_BAO_ACL',
294 'type' => 'CheckBox',
298 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
300 return Civi
::$statics[__CLASS__
]['fields'];
304 * Return a mapping from field-name to the corresponding key (as used in fields()).
307 * Array(string $name => string $uniqueName).
309 public static function &fieldKeys() {
310 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
311 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
313 return Civi
::$statics[__CLASS__
]['fieldKeys'];
317 * Returns the names of this table
321 public static function getTableName() {
322 return self
::$_tableName;
326 * Returns if this table needs to be logged
330 public function getLog() {
335 * Returns the list of fields that can be imported
337 * @param bool $prefix
341 public static function &import($prefix = FALSE) {
342 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl', $prefix, []);
347 * Returns the list of fields that can be exported
349 * @param bool $prefix
353 public static function &export($prefix = FALSE) {
354 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl', $prefix, []);
359 * Returns the list of indices
361 * @param bool $localize
365 public static function indices($localize = TRUE) {
368 'name' => 'index_acl_id',
372 'localizable' => FALSE,
373 'sig' => 'civicrm_acl::0::acl_id',
376 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;