Merge pull request #16112 from seamuslee001/remove_zend_validator
[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
1ec2637a 9 * (GenCodeChecksum:9428e81469c11a64dc2e7490da81a439)
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',
c3fc2621
CW
114 ],
115 'acl_id' => [
e501603b
TO
116 'name' => 'acl_id',
117 'type' => CRM_Utils_Type::T_INT,
c3fc2621 118 'title' => ts('Cache ACL'),
215b423e 119 'description' => ts('Foreign Key to ACL'),
c3fc2621 120 'required' => TRUE,
a36434b9 121 'where' => 'civicrm_acl_cache.acl_id',
522a26c9 122 'table_name' => 'civicrm_acl_cache',
28fec8aa
PN
123 'entity' => 'ACLCache',
124 'bao' => 'CRM_ACL_DAO_ACLCache',
6a7e5e5d 125 'localizable' => 0,
e501603b 126 'FKClassName' => 'CRM_ACL_DAO_ACL',
c3fc2621
CW
127 ],
128 'modified_date' => [
e501603b
TO
129 'name' => 'modified_date',
130 'type' => CRM_Utils_Type::T_TIMESTAMP,
c3fc2621 131 'title' => ts('Cache Modified Date'),
215b423e 132 'description' => ts('When was this cache entry last modified'),
c3fc2621 133 'required' => FALSE,
a36434b9 134 'where' => 'civicrm_acl_cache.modified_date',
522a26c9 135 'table_name' => 'civicrm_acl_cache',
28fec8aa
PN
136 'entity' => 'ACLCache',
137 'bao' => 'CRM_ACL_DAO_ACLCache',
6a7e5e5d 138 'localizable' => 0,
c3fc2621
CW
139 ],
140 ];
346aaaba 141 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 142 }
346aaaba 143 return Civi::$statics[__CLASS__]['fields'];
e501603b 144 }
c3fc2621 145
e501603b 146 /**
bd8e0b14 147 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
148 *
149 * @return array
bd8e0b14 150 * Array(string $name => string $uniqueName).
e501603b 151 */
c3fc2621 152 public static function &fieldKeys() {
bd8e0b14
TO
153 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
154 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 155 }
bd8e0b14 156 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 157 }
c3fc2621 158
e501603b
TO
159 /**
160 * Returns the names of this table
161 *
162 * @return string
163 */
c3fc2621 164 public static function getTableName() {
e501603b
TO
165 return self::$_tableName;
166 }
c3fc2621 167
e501603b
TO
168 /**
169 * Returns if this table needs to be logged
170 *
c3fc2621 171 * @return bool
e501603b 172 */
c3fc2621 173 public function getLog() {
e501603b
TO
174 return self::$_log;
175 }
c3fc2621 176
e501603b
TO
177 /**
178 * Returns the list of fields that can be imported
179 *
180 * @param bool $prefix
181 *
182 * @return array
183 */
c3fc2621
CW
184 public static function &import($prefix = FALSE) {
185 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'acl_cache', $prefix, []);
60808919 186 return $r;
e501603b 187 }
c3fc2621 188
e501603b
TO
189 /**
190 * Returns the list of fields that can be exported
191 *
192 * @param bool $prefix
193 *
194 * @return array
195 */
c3fc2621
CW
196 public static function &export($prefix = FALSE) {
197 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'acl_cache', $prefix, []);
60808919 198 return $r;
e501603b 199 }
c3fc2621 200
e7a6b91a
AS
201 /**
202 * Returns the list of indices
c3fc2621
CW
203 *
204 * @param bool $localize
205 *
206 * @return array
e7a6b91a
AS
207 */
208 public static function indices($localize = TRUE) {
c3fc2621
CW
209 $indices = [
210 'index_acl_id' => [
e7a6b91a 211 'name' => 'index_acl_id',
c3fc2621 212 'field' => [
e7a6b91a 213 0 => 'acl_id',
c3fc2621
CW
214 ],
215 'localizable' => FALSE,
e7a6b91a 216 'sig' => 'civicrm_acl_cache::0::acl_id',
c3fc2621 217 ],
1ec2637a 218 'index_modified_date' => [
219 'name' => 'index_modified_date',
220 'field' => [
221 0 => 'modified_date',
222 ],
223 'localizable' => FALSE,
224 'sig' => 'civicrm_acl_cache::0::modified_date',
225 ],
c3fc2621 226 ];
e7a6b91a
AS
227 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
228 }
c3fc2621 229
e501603b 230}