5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/ACL/ACLCache.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:329e9070bd70f3fb3d053eb731d1b266)
13 * Database access object for the ACLCache entity.
15 class CRM_ACL_DAO_ACLCache
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_cache';
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.
43 * Foreign Key to Contact
45 * @var int|string|null
46 * (SQL type: int unsigned)
47 * Note that values will be retrieved from the database as a string.
55 * (SQL type: int unsigned)
56 * Note that values will be retrieved from the database as a string.
61 * When was this cache entry last modified
64 * (SQL type: timestamp)
65 * Note that values will be retrieved from the database as a string.
67 public $modified_date;
72 public function __construct() {
73 $this->__table
= 'civicrm_acl_cache';
74 parent
::__construct();
78 * Returns localized title of this entity.
81 * Whether to return the plural version of the title.
83 public static function getEntityTitle($plural = FALSE) {
84 return $plural ?
ts('ACLCaches') : ts('ACLCache');
88 * Returns foreign keys and entity references.
91 * [CRM_Core_Reference_Interface]
93 public static function getReferenceColumns() {
94 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
95 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
96 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'acl_id', 'civicrm_acl', 'id');
97 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
99 return Civi
::$statics[__CLASS__
]['links'];
103 * Returns all the column names of this table
107 public static function &fields() {
108 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
109 Civi
::$statics[__CLASS__
]['fields'] = [
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('Cache ID'),
114 'description' => ts('Unique table ID'),
116 'where' => 'civicrm_acl_cache.id',
117 'table_name' => 'civicrm_acl_cache',
118 'entity' => 'ACLCache',
119 'bao' => 'CRM_ACL_DAO_ACLCache',
128 'name' => 'contact_id',
129 'type' => CRM_Utils_Type
::T_INT
,
130 'title' => ts('Contact ID'),
131 'description' => ts('Foreign Key to Contact'),
132 'where' => 'civicrm_acl_cache.contact_id',
133 'table_name' => 'civicrm_acl_cache',
134 'entity' => 'ACLCache',
135 'bao' => 'CRM_ACL_DAO_ACLCache',
138 'type' => 'EntityRef',
139 'label' => ts("Contact"),
145 'type' => CRM_Utils_Type
::T_INT
,
146 'title' => ts('ACL ID'),
147 'description' => ts('Foreign Key to ACL'),
149 'where' => 'civicrm_acl_cache.acl_id',
150 'table_name' => 'civicrm_acl_cache',
151 'entity' => 'ACLCache',
152 'bao' => 'CRM_ACL_DAO_ACLCache',
154 'FKClassName' => 'CRM_ACL_DAO_ACL',
156 'label' => ts("ACL"),
158 'pseudoconstant' => [
159 'table' => 'civicrm_acl',
161 'labelColumn' => 'name',
166 'name' => 'modified_date',
167 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
168 'title' => ts('Cache Modified Date'),
169 'description' => ts('When was this cache entry last modified'),
171 'where' => 'civicrm_acl_cache.modified_date',
172 'table_name' => 'civicrm_acl_cache',
173 'entity' => 'ACLCache',
174 'bao' => 'CRM_ACL_DAO_ACLCache',
179 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
181 return Civi
::$statics[__CLASS__
]['fields'];
185 * Return a mapping from field-name to the corresponding key (as used in fields()).
188 * Array(string $name => string $uniqueName).
190 public static function &fieldKeys() {
191 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
192 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
194 return Civi
::$statics[__CLASS__
]['fieldKeys'];
198 * Returns the names of this table
202 public static function getTableName() {
203 return self
::$_tableName;
207 * Returns if this table needs to be logged
211 public function getLog() {
216 * Returns the list of fields that can be imported
218 * @param bool $prefix
222 public static function &import($prefix = FALSE) {
223 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl_cache', $prefix, []);
228 * Returns the list of fields that can be exported
230 * @param bool $prefix
234 public static function &export($prefix = FALSE) {
235 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl_cache', $prefix, []);
240 * Returns the list of indices
242 * @param bool $localize
246 public static function indices($localize = TRUE) {
248 'index_contact_id' => [
249 'name' => 'index_contact_id',
253 'localizable' => FALSE,
254 'sig' => 'civicrm_acl_cache::0::contact_id',
257 'name' => 'index_acl_id',
261 'localizable' => FALSE,
262 'sig' => 'civicrm_acl_cache::0::acl_id',
264 'index_modified_date' => [
265 'name' => 'index_modified_date',
267 0 => 'modified_date',
269 'localizable' => FALSE,
270 'sig' => 'civicrm_acl_cache::0::modified_date',
273 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;