Merge pull request #17187 from alexymik/recur_contribution_source
[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:976ef3393c10c32cacd6c6405b892533)
10 */
11
12 /**
13 * Database access object for the ACLCache entity.
14 */
15 class 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 foreign keys and entity references.
69 *
70 * @return array
71 * [CRM_Core_Reference_Interface]
72 */
73 public static function getReferenceColumns() {
74 if (!isset(Civi::$statics[__CLASS__]['links'])) {
75 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
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');
78 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
79 }
80 return Civi::$statics[__CLASS__]['links'];
81 }
82
83 /**
84 * Returns all the column names of this table
85 *
86 * @return array
87 */
88 public static function &fields() {
89 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
90 Civi::$statics[__CLASS__]['fields'] = [
91 'id' => [
92 'name' => 'id',
93 'type' => CRM_Utils_Type::T_INT,
94 'title' => ts('Cache ID'),
95 'description' => ts('Unique table ID'),
96 'required' => TRUE,
97 'where' => 'civicrm_acl_cache.id',
98 'table_name' => 'civicrm_acl_cache',
99 'entity' => 'ACLCache',
100 'bao' => 'CRM_ACL_DAO_ACLCache',
101 'localizable' => 0,
102 ],
103 'contact_id' => [
104 'name' => 'contact_id',
105 'type' => CRM_Utils_Type::T_INT,
106 'title' => ts('Cache Contact'),
107 'description' => ts('Foreign Key to Contact'),
108 'where' => 'civicrm_acl_cache.contact_id',
109 'table_name' => 'civicrm_acl_cache',
110 'entity' => 'ACLCache',
111 'bao' => 'CRM_ACL_DAO_ACLCache',
112 'localizable' => 0,
113 'FKClassName' => 'CRM_Contact_DAO_Contact',
114 'html' => [
115 'type' => 'EntityRef',
116 ],
117 ],
118 'acl_id' => [
119 'name' => 'acl_id',
120 'type' => CRM_Utils_Type::T_INT,
121 'title' => ts('Cache ACL'),
122 'description' => ts('Foreign Key to ACL'),
123 'required' => TRUE,
124 'where' => 'civicrm_acl_cache.acl_id',
125 'table_name' => 'civicrm_acl_cache',
126 'entity' => 'ACLCache',
127 'bao' => 'CRM_ACL_DAO_ACLCache',
128 'localizable' => 0,
129 'FKClassName' => 'CRM_ACL_DAO_ACL',
130 'pseudoconstant' => [
131 'table' => 'civicrm_acl',
132 'keyColumn' => 'id',
133 'labelColumn' => 'name',
134 ],
135 ],
136 'modified_date' => [
137 'name' => 'modified_date',
138 'type' => CRM_Utils_Type::T_TIMESTAMP,
139 'title' => ts('Cache Modified Date'),
140 'description' => ts('When was this cache entry last modified'),
141 'required' => FALSE,
142 'where' => 'civicrm_acl_cache.modified_date',
143 'table_name' => 'civicrm_acl_cache',
144 'entity' => 'ACLCache',
145 'bao' => 'CRM_ACL_DAO_ACLCache',
146 'localizable' => 0,
147 ],
148 ];
149 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
150 }
151 return Civi::$statics[__CLASS__]['fields'];
152 }
153
154 /**
155 * Return a mapping from field-name to the corresponding key (as used in fields()).
156 *
157 * @return array
158 * Array(string $name => string $uniqueName).
159 */
160 public static function &fieldKeys() {
161 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
162 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
163 }
164 return Civi::$statics[__CLASS__]['fieldKeys'];
165 }
166
167 /**
168 * Returns the names of this table
169 *
170 * @return string
171 */
172 public static function getTableName() {
173 return self::$_tableName;
174 }
175
176 /**
177 * Returns if this table needs to be logged
178 *
179 * @return bool
180 */
181 public function getLog() {
182 return self::$_log;
183 }
184
185 /**
186 * Returns the list of fields that can be imported
187 *
188 * @param bool $prefix
189 *
190 * @return array
191 */
192 public static function &import($prefix = FALSE) {
193 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'acl_cache', $prefix, []);
194 return $r;
195 }
196
197 /**
198 * Returns the list of fields that can be exported
199 *
200 * @param bool $prefix
201 *
202 * @return array
203 */
204 public static function &export($prefix = FALSE) {
205 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'acl_cache', $prefix, []);
206 return $r;
207 }
208
209 /**
210 * Returns the list of indices
211 *
212 * @param bool $localize
213 *
214 * @return array
215 */
216 public static function indices($localize = TRUE) {
217 $indices = [
218 'index_acl_id' => [
219 'name' => 'index_acl_id',
220 'field' => [
221 0 => 'acl_id',
222 ],
223 'localizable' => FALSE,
224 'sig' => 'civicrm_acl_cache::0::acl_id',
225 ],
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 ],
234 ];
235 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
236 }
237
238 }