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