Merge pull request #21943 from mattwire/gccacheignore
[civicrm-core.git] / CRM / ACL / DAO / ACLCache.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/ACL/ACLCache.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:329e9070bd70f3fb3d053eb731d1b266)
10 */
11
12 /**
13 * Database access object for the ACLCache entity.
14 */
15 class CRM_ACL_DAO_ACLCache extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '1.6';
18
19 /**
20 * Static instance to hold the table name.
21 *
22 * @var string
23 */
24 public static $_tableName = 'civicrm_acl_cache';
25
26 /**
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
28 *
29 * @var bool
30 */
31 public static $_log = FALSE;
32
33 /**
34 * Unique table ID
35 *
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
39 */
40 public $id;
41
42 /**
43 * Foreign Key to Contact
44 *
45 * @var int|string|null
46 * (SQL type: int unsigned)
47 * Note that values will be retrieved from the database as a string.
48 */
49 public $contact_id;
50
51 /**
52 * Foreign Key to ACL
53 *
54 * @var int|string
55 * (SQL type: int unsigned)
56 * Note that values will be retrieved from the database as a string.
57 */
58 public $acl_id;
59
60 /**
61 * When was this cache entry last modified
62 *
63 * @var string
64 * (SQL type: timestamp)
65 * Note that values will be retrieved from the database as a string.
66 */
67 public $modified_date;
68
69 /**
70 * Class constructor.
71 */
72 public function __construct() {
73 $this->__table = 'civicrm_acl_cache';
74 parent::__construct();
75 }
76
77 /**
78 * Returns localized title of this entity.
79 *
80 * @param bool $plural
81 * Whether to return the plural version of the title.
82 */
83 public static function getEntityTitle($plural = FALSE) {
84 return $plural ? ts('ACLCaches') : ts('ACLCache');
85 }
86
87 /**
88 * Returns foreign keys and entity references.
89 *
90 * @return array
91 * [CRM_Core_Reference_Interface]
92 */
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']);
98 }
99 return Civi::$statics[__CLASS__]['links'];
100 }
101
102 /**
103 * Returns all the column names of this table
104 *
105 * @return array
106 */
107 public static function &fields() {
108 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
109 Civi::$statics[__CLASS__]['fields'] = [
110 'id' => [
111 'name' => 'id',
112 'type' => CRM_Utils_Type::T_INT,
113 'title' => ts('Cache ID'),
114 'description' => ts('Unique table ID'),
115 'required' => TRUE,
116 'where' => 'civicrm_acl_cache.id',
117 'table_name' => 'civicrm_acl_cache',
118 'entity' => 'ACLCache',
119 'bao' => 'CRM_ACL_DAO_ACLCache',
120 'localizable' => 0,
121 'html' => [
122 'type' => 'Number',
123 ],
124 'readonly' => TRUE,
125 'add' => '1.6',
126 ],
127 'contact_id' => [
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',
136 'localizable' => 0,
137 'html' => [
138 'type' => 'EntityRef',
139 'label' => ts("Contact"),
140 ],
141 'add' => '1.6',
142 ],
143 'acl_id' => [
144 'name' => 'acl_id',
145 'type' => CRM_Utils_Type::T_INT,
146 'title' => ts('ACL ID'),
147 'description' => ts('Foreign Key to ACL'),
148 'required' => TRUE,
149 'where' => 'civicrm_acl_cache.acl_id',
150 'table_name' => 'civicrm_acl_cache',
151 'entity' => 'ACLCache',
152 'bao' => 'CRM_ACL_DAO_ACLCache',
153 'localizable' => 0,
154 'FKClassName' => 'CRM_ACL_DAO_ACL',
155 'html' => [
156 'label' => ts("ACL"),
157 ],
158 'pseudoconstant' => [
159 'table' => 'civicrm_acl',
160 'keyColumn' => 'id',
161 'labelColumn' => 'name',
162 ],
163 'add' => '1.6',
164 ],
165 'modified_date' => [
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'),
170 'required' => FALSE,
171 'where' => 'civicrm_acl_cache.modified_date',
172 'table_name' => 'civicrm_acl_cache',
173 'entity' => 'ACLCache',
174 'bao' => 'CRM_ACL_DAO_ACLCache',
175 'localizable' => 0,
176 'add' => '1.6',
177 ],
178 ];
179 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
180 }
181 return Civi::$statics[__CLASS__]['fields'];
182 }
183
184 /**
185 * Return a mapping from field-name to the corresponding key (as used in fields()).
186 *
187 * @return array
188 * Array(string $name => string $uniqueName).
189 */
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()));
193 }
194 return Civi::$statics[__CLASS__]['fieldKeys'];
195 }
196
197 /**
198 * Returns the names of this table
199 *
200 * @return string
201 */
202 public static function getTableName() {
203 return self::$_tableName;
204 }
205
206 /**
207 * Returns if this table needs to be logged
208 *
209 * @return bool
210 */
211 public function getLog() {
212 return self::$_log;
213 }
214
215 /**
216 * Returns the list of fields that can be imported
217 *
218 * @param bool $prefix
219 *
220 * @return array
221 */
222 public static function &import($prefix = FALSE) {
223 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'acl_cache', $prefix, []);
224 return $r;
225 }
226
227 /**
228 * Returns the list of fields that can be exported
229 *
230 * @param bool $prefix
231 *
232 * @return array
233 */
234 public static function &export($prefix = FALSE) {
235 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'acl_cache', $prefix, []);
236 return $r;
237 }
238
239 /**
240 * Returns the list of indices
241 *
242 * @param bool $localize
243 *
244 * @return array
245 */
246 public static function indices($localize = TRUE) {
247 $indices = [
248 'index_contact_id' => [
249 'name' => 'index_contact_id',
250 'field' => [
251 0 => 'contact_id',
252 ],
253 'localizable' => FALSE,
254 'sig' => 'civicrm_acl_cache::0::contact_id',
255 ],
256 'index_acl_id' => [
257 'name' => 'index_acl_id',
258 'field' => [
259 0 => 'acl_id',
260 ],
261 'localizable' => FALSE,
262 'sig' => 'civicrm_acl_cache::0::acl_id',
263 ],
264 'index_modified_date' => [
265 'name' => 'index_modified_date',
266 'field' => [
267 0 => 'modified_date',
268 ],
269 'localizable' => FALSE,
270 'sig' => 'civicrm_acl_cache::0::modified_date',
271 ],
272 ];
273 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
274 }
275
276 }