Merge pull request #16837 from tunbola/case-api-case-clients
[civicrm-core.git] / CRM / ACL / DAO / ACLCache.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
ca5cec67 5 * @copyright CiviCRM LLC https://civicrm.org/licensing
e501603b 6 *
28fec8aa 7 * Generated from xml/schema/CRM/ACL/ACLCache.xml
e501603b 8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
1906ff52 9 * (GenCodeChecksum:976ef3393c10c32cacd6c6405b892533)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
28fec8aa 13 * Database access object for the ACLCache entity.
f41f0342 14 */
28fec8aa 15class CRM_ACL_DAO_ACLCache extends CRM_Core_DAO {
c3fc2621 16
e501603b 17 /**
f41f0342 18 * Static instance to hold the table name.
e501603b
TO
19 *
20 * @var string
21 */
fa45b5b9 22 public static $_tableName = 'civicrm_acl_cache';
c3fc2621 23
e501603b 24 /**
f41f0342 25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 26 *
c3fc2621 27 * @var bool
e501603b 28 */
fa45b5b9 29 public static $_log = FALSE;
c3fc2621 30
e501603b
TO
31 /**
32 * Unique table ID
33 *
e6ca0a57 34 * @var int
e501603b
TO
35 */
36 public $id;
c3fc2621 37
e501603b
TO
38 /**
39 * Foreign Key to Contact
40 *
e6ca0a57 41 * @var int
e501603b
TO
42 */
43 public $contact_id;
c3fc2621 44
e501603b
TO
45 /**
46 * Foreign Key to ACL
47 *
e6ca0a57 48 * @var int
e501603b
TO
49 */
50 public $acl_id;
c3fc2621 51
e501603b
TO
52 /**
53 * When was this cache entry last modified
54 *
55 * @var timestamp
56 */
57 public $modified_date;
c3fc2621 58
e501603b 59 /**
f41f0342 60 * Class constructor.
e501603b 61 */
c3fc2621 62 public function __construct() {
e501603b
TO
63 $this->__table = 'civicrm_acl_cache';
64 parent::__construct();
65 }
c3fc2621 66
e501603b 67 /**
f41f0342 68 * Returns foreign keys and entity references.
e501603b
TO
69 *
70 * @return array
71 * [CRM_Core_Reference_Interface]
72 */
c3fc2621 73 public static function getReferenceColumns() {
346aaaba 74 if (!isset(Civi::$statics[__CLASS__]['links'])) {
cf0d1c08 75 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621
CW
76 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id');
77 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'acl_id', 'civicrm_acl', 'id');
346aaaba 78 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 79 }
346aaaba 80 return Civi::$statics[__CLASS__]['links'];
e501603b 81 }
c3fc2621 82
e501603b
TO
83 /**
84 * Returns all the column names of this table
85 *
86 * @return array
87 */
c3fc2621 88 public static function &fields() {
346aaaba 89 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
90 Civi::$statics[__CLASS__]['fields'] = [
91 'id' => [
e501603b
TO
92 'name' => 'id',
93 'type' => CRM_Utils_Type::T_INT,
c3fc2621 94 'title' => ts('Cache ID'),
215b423e 95 'description' => ts('Unique table ID'),
c3fc2621 96 'required' => TRUE,
a36434b9 97 'where' => 'civicrm_acl_cache.id',
522a26c9 98 'table_name' => 'civicrm_acl_cache',
28fec8aa
PN
99 'entity' => 'ACLCache',
100 'bao' => 'CRM_ACL_DAO_ACLCache',
6a7e5e5d 101 'localizable' => 0,
c3fc2621
CW
102 ],
103 'contact_id' => [
e501603b
TO
104 'name' => 'contact_id',
105 'type' => CRM_Utils_Type::T_INT,
c3fc2621 106 'title' => ts('Cache Contact'),
215b423e 107 'description' => ts('Foreign Key to Contact'),
a36434b9 108 'where' => 'civicrm_acl_cache.contact_id',
522a26c9 109 'table_name' => 'civicrm_acl_cache',
28fec8aa
PN
110 'entity' => 'ACLCache',
111 'bao' => 'CRM_ACL_DAO_ACLCache',
6a7e5e5d 112 'localizable' => 0,
e501603b 113 'FKClassName' => 'CRM_Contact_DAO_Contact',
1906ff52
PN
114 'html' => [
115 'type' => 'EntityRef',
116 ],
c3fc2621
CW
117 ],
118 'acl_id' => [
e501603b
TO
119 'name' => 'acl_id',
120 'type' => CRM_Utils_Type::T_INT,
c3fc2621 121 'title' => ts('Cache ACL'),
215b423e 122 'description' => ts('Foreign Key to ACL'),
c3fc2621 123 'required' => TRUE,
a36434b9 124 'where' => 'civicrm_acl_cache.acl_id',
522a26c9 125 'table_name' => 'civicrm_acl_cache',
28fec8aa
PN
126 'entity' => 'ACLCache',
127 'bao' => 'CRM_ACL_DAO_ACLCache',
6a7e5e5d 128 'localizable' => 0,
e501603b 129 'FKClassName' => 'CRM_ACL_DAO_ACL',
1906ff52
PN
130 'pseudoconstant' => [
131 'table' => 'civicrm_acl',
132 'keyColumn' => 'id',
133 'labelColumn' => 'name',
134 ],
c3fc2621
CW
135 ],
136 'modified_date' => [
e501603b
TO
137 'name' => 'modified_date',
138 'type' => CRM_Utils_Type::T_TIMESTAMP,
c3fc2621 139 'title' => ts('Cache Modified Date'),
215b423e 140 'description' => ts('When was this cache entry last modified'),
c3fc2621 141 'required' => FALSE,
a36434b9 142 'where' => 'civicrm_acl_cache.modified_date',
522a26c9 143 'table_name' => 'civicrm_acl_cache',
28fec8aa
PN
144 'entity' => 'ACLCache',
145 'bao' => 'CRM_ACL_DAO_ACLCache',
6a7e5e5d 146 'localizable' => 0,
c3fc2621
CW
147 ],
148 ];
346aaaba 149 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 150 }
346aaaba 151 return Civi::$statics[__CLASS__]['fields'];
e501603b 152 }
c3fc2621 153
e501603b 154 /**
bd8e0b14 155 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
156 *
157 * @return array
bd8e0b14 158 * Array(string $name => string $uniqueName).
e501603b 159 */
c3fc2621 160 public static function &fieldKeys() {
bd8e0b14
TO
161 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
162 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 163 }
bd8e0b14 164 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 165 }
c3fc2621 166
e501603b
TO
167 /**
168 * Returns the names of this table
169 *
170 * @return string
171 */
c3fc2621 172 public static function getTableName() {
e501603b
TO
173 return self::$_tableName;
174 }
c3fc2621 175
e501603b
TO
176 /**
177 * Returns if this table needs to be logged
178 *
c3fc2621 179 * @return bool
e501603b 180 */
c3fc2621 181 public function getLog() {
e501603b
TO
182 return self::$_log;
183 }
c3fc2621 184
e501603b
TO
185 /**
186 * Returns the list of fields that can be imported
187 *
188 * @param bool $prefix
189 *
190 * @return array
191 */
c3fc2621
CW
192 public static function &import($prefix = FALSE) {
193 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'acl_cache', $prefix, []);
60808919 194 return $r;
e501603b 195 }
c3fc2621 196
e501603b
TO
197 /**
198 * Returns the list of fields that can be exported
199 *
200 * @param bool $prefix
201 *
202 * @return array
203 */
c3fc2621
CW
204 public static function &export($prefix = FALSE) {
205 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'acl_cache', $prefix, []);
60808919 206 return $r;
e501603b 207 }
c3fc2621 208
e7a6b91a
AS
209 /**
210 * Returns the list of indices
c3fc2621
CW
211 *
212 * @param bool $localize
213 *
214 * @return array
e7a6b91a
AS
215 */
216 public static function indices($localize = TRUE) {
c3fc2621
CW
217 $indices = [
218 'index_acl_id' => [
e7a6b91a 219 'name' => 'index_acl_id',
c3fc2621 220 'field' => [
e7a6b91a 221 0 => 'acl_id',
c3fc2621
CW
222 ],
223 'localizable' => FALSE,
e7a6b91a 224 'sig' => 'civicrm_acl_cache::0::acl_id',
c3fc2621 225 ],
1ec2637a 226 'index_modified_date' => [
227 'name' => 'index_modified_date',
228 'field' => [
229 0 => 'modified_date',
230 ],
231 'localizable' => FALSE,
232 'sig' => 'civicrm_acl_cache::0::modified_date',
233 ],
c3fc2621 234 ];
e7a6b91a
AS
235 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
236 }
c3fc2621 237
e501603b 238}