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:5dae38d9d5e128062b634a01ccfad2b0)
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 foreign keys and entity references.
120 * [CRM_Core_Reference_Interface]
122 public static function getReferenceColumns() {
123 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
124 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
125 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
126 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
128 return Civi
::$statics[__CLASS__
]['links'];
132 * Returns all the column names of this table
136 public static function &fields() {
137 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
138 Civi
::$statics[__CLASS__
]['fields'] = [
141 'type' => CRM_Utils_Type
::T_INT
,
142 'title' => ts('ACL ID'),
143 'description' => ts('Unique table ID'),
145 'where' => 'civicrm_acl.id',
146 'table_name' => 'civicrm_acl',
148 'bao' => 'CRM_ACL_BAO_ACL',
153 'type' => CRM_Utils_Type
::T_STRING
,
154 'title' => ts('ACL Name'),
155 'description' => ts('ACL Name.'),
157 'size' => CRM_Utils_Type
::BIG
,
158 'where' => 'civicrm_acl.name',
159 'table_name' => 'civicrm_acl',
161 'bao' => 'CRM_ACL_BAO_ACL',
169 'type' => CRM_Utils_Type
::T_BOOLEAN
,
170 'title' => ts('Deny ACL?'),
171 'description' => ts('Is this ACL entry Allow (0) or Deny (1) ?'),
173 'where' => 'civicrm_acl.deny',
175 'table_name' => 'civicrm_acl',
177 'bao' => 'CRM_ACL_BAO_ACL',
184 'name' => 'entity_table',
185 'type' => CRM_Utils_Type
::T_STRING
,
186 'title' => ts('ACL Entity'),
187 'description' => ts('Table of the object possessing this ACL entry (Contact, Group, or ACL Group)'),
190 'size' => CRM_Utils_Type
::BIG
,
191 'where' => 'civicrm_acl.entity_table',
192 'table_name' => 'civicrm_acl',
194 'bao' => 'CRM_ACL_BAO_ACL',
198 'name' => 'entity_id',
199 'type' => CRM_Utils_Type
::T_INT
,
200 'title' => ts('Entity ID'),
201 'description' => ts('ID of the object possessing this ACL'),
202 'where' => 'civicrm_acl.entity_id',
203 'table_name' => 'civicrm_acl',
205 'bao' => 'CRM_ACL_BAO_ACL',
209 'name' => 'operation',
210 'type' => CRM_Utils_Type
::T_STRING
,
211 'title' => ts('ACL Operation'),
212 'description' => ts('What operation does this ACL entry control?'),
215 'size' => CRM_Utils_Type
::EIGHT
,
216 'where' => 'civicrm_acl.operation',
217 'table_name' => 'civicrm_acl',
219 'bao' => 'CRM_ACL_BAO_ACL',
224 'pseudoconstant' => [
225 'callback' => 'CRM_ACL_BAO_ACL::operation',
229 'name' => 'object_table',
230 'type' => CRM_Utils_Type
::T_STRING
,
231 'title' => ts('ACL Object'),
232 'description' => ts('The table of the object controlled by this ACL entry'),
234 'size' => CRM_Utils_Type
::BIG
,
235 'where' => 'civicrm_acl.object_table',
236 'table_name' => 'civicrm_acl',
238 'bao' => 'CRM_ACL_BAO_ACL',
242 'name' => 'object_id',
243 'type' => CRM_Utils_Type
::T_INT
,
244 'title' => ts('ACL Object ID'),
245 'description' => ts('The ID of the object controlled by this ACL entry'),
246 'where' => 'civicrm_acl.object_id',
247 'table_name' => 'civicrm_acl',
249 'bao' => 'CRM_ACL_BAO_ACL',
253 'name' => 'acl_table',
254 'type' => CRM_Utils_Type
::T_STRING
,
255 'title' => ts('ACL Table'),
256 'description' => ts('If this is a grant/revoke entry, what table are we granting?'),
258 'size' => CRM_Utils_Type
::BIG
,
259 'where' => 'civicrm_acl.acl_table',
260 'table_name' => 'civicrm_acl',
262 'bao' => 'CRM_ACL_BAO_ACL',
267 'type' => CRM_Utils_Type
::T_INT
,
268 'title' => ts('ACL Group ID'),
269 'description' => ts('ID of the ACL or ACL group being granted/revoked'),
270 'where' => 'civicrm_acl.acl_id',
271 'table_name' => 'civicrm_acl',
273 'bao' => 'CRM_ACL_BAO_ACL',
277 'name' => 'is_active',
278 'type' => CRM_Utils_Type
::T_BOOLEAN
,
279 'title' => ts('ACL Is Active?'),
280 'description' => ts('Is this property active?'),
281 'where' => 'civicrm_acl.is_active',
282 'table_name' => 'civicrm_acl',
284 'bao' => 'CRM_ACL_BAO_ACL',
287 'type' => 'CheckBox',
291 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
293 return Civi
::$statics[__CLASS__
]['fields'];
297 * Return a mapping from field-name to the corresponding key (as used in fields()).
300 * Array(string $name => string $uniqueName).
302 public static function &fieldKeys() {
303 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
304 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
306 return Civi
::$statics[__CLASS__
]['fieldKeys'];
310 * Returns the names of this table
314 public static function getTableName() {
315 return self
::$_tableName;
319 * Returns if this table needs to be logged
323 public function getLog() {
328 * Returns the list of fields that can be imported
330 * @param bool $prefix
334 public static function &import($prefix = FALSE) {
335 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl', $prefix, []);
340 * Returns the list of fields that can be exported
342 * @param bool $prefix
346 public static function &export($prefix = FALSE) {
347 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl', $prefix, []);
352 * Returns the list of indices
354 * @param bool $localize
358 public static function indices($localize = TRUE) {
361 'name' => 'index_acl_id',
365 'localizable' => FALSE,
366 'sig' => 'civicrm_acl::0::acl_id',
369 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;