Add titles and icons to entities
[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
449c4e6b 9 * (GenCodeChecksum:ca99bbbd188d9c890d47e35c1b0b3bbd)
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
449c4e6b
CW
67 /**
68 * Returns localized title of this entity.
69 */
70 public static function getEntityTitle() {
71 return ts('ACLCaches');
72 }
73
e501603b 74 /**
f41f0342 75 * Returns foreign keys and entity references.
e501603b
TO
76 *
77 * @return array
78 * [CRM_Core_Reference_Interface]
79 */
c3fc2621 80 public static function getReferenceColumns() {
346aaaba 81 if (!isset(Civi::$statics[__CLASS__]['links'])) {
cf0d1c08 82 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621
CW
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');
346aaaba 85 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 86 }
346aaaba 87 return Civi::$statics[__CLASS__]['links'];
e501603b 88 }
c3fc2621 89
e501603b
TO
90 /**
91 * Returns all the column names of this table
92 *
93 * @return array
94 */
c3fc2621 95 public static function &fields() {
346aaaba 96 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
97 Civi::$statics[__CLASS__]['fields'] = [
98 'id' => [
e501603b
TO
99 'name' => 'id',
100 'type' => CRM_Utils_Type::T_INT,
c3fc2621 101 'title' => ts('Cache ID'),
215b423e 102 'description' => ts('Unique table ID'),
c3fc2621 103 'required' => TRUE,
a36434b9 104 'where' => 'civicrm_acl_cache.id',
522a26c9 105 'table_name' => 'civicrm_acl_cache',
28fec8aa
PN
106 'entity' => 'ACLCache',
107 'bao' => 'CRM_ACL_DAO_ACLCache',
6a7e5e5d 108 'localizable' => 0,
c3fc2621
CW
109 ],
110 'contact_id' => [
e501603b
TO
111 'name' => 'contact_id',
112 'type' => CRM_Utils_Type::T_INT,
c3fc2621 113 'title' => ts('Cache Contact'),
215b423e 114 'description' => ts('Foreign Key to Contact'),
a36434b9 115 'where' => 'civicrm_acl_cache.contact_id',
522a26c9 116 'table_name' => 'civicrm_acl_cache',
28fec8aa
PN
117 'entity' => 'ACLCache',
118 'bao' => 'CRM_ACL_DAO_ACLCache',
6a7e5e5d 119 'localizable' => 0,
e501603b 120 'FKClassName' => 'CRM_Contact_DAO_Contact',
1906ff52
PN
121 'html' => [
122 'type' => 'EntityRef',
123 ],
c3fc2621
CW
124 ],
125 'acl_id' => [
e501603b
TO
126 'name' => 'acl_id',
127 'type' => CRM_Utils_Type::T_INT,
c3fc2621 128 'title' => ts('Cache ACL'),
215b423e 129 'description' => ts('Foreign Key to ACL'),
c3fc2621 130 'required' => TRUE,
a36434b9 131 'where' => 'civicrm_acl_cache.acl_id',
522a26c9 132 'table_name' => 'civicrm_acl_cache',
28fec8aa
PN
133 'entity' => 'ACLCache',
134 'bao' => 'CRM_ACL_DAO_ACLCache',
6a7e5e5d 135 'localizable' => 0,
e501603b 136 'FKClassName' => 'CRM_ACL_DAO_ACL',
1906ff52
PN
137 'pseudoconstant' => [
138 'table' => 'civicrm_acl',
139 'keyColumn' => 'id',
140 'labelColumn' => 'name',
141 ],
c3fc2621
CW
142 ],
143 'modified_date' => [
e501603b
TO
144 'name' => 'modified_date',
145 'type' => CRM_Utils_Type::T_TIMESTAMP,
c3fc2621 146 'title' => ts('Cache Modified Date'),
215b423e 147 'description' => ts('When was this cache entry last modified'),
c3fc2621 148 'required' => FALSE,
a36434b9 149 'where' => 'civicrm_acl_cache.modified_date',
522a26c9 150 'table_name' => 'civicrm_acl_cache',
28fec8aa
PN
151 'entity' => 'ACLCache',
152 'bao' => 'CRM_ACL_DAO_ACLCache',
6a7e5e5d 153 'localizable' => 0,
c3fc2621
CW
154 ],
155 ];
346aaaba 156 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 157 }
346aaaba 158 return Civi::$statics[__CLASS__]['fields'];
e501603b 159 }
c3fc2621 160
e501603b 161 /**
bd8e0b14 162 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
163 *
164 * @return array
bd8e0b14 165 * Array(string $name => string $uniqueName).
e501603b 166 */
c3fc2621 167 public static function &fieldKeys() {
bd8e0b14
TO
168 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
169 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 170 }
bd8e0b14 171 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 172 }
c3fc2621 173
e501603b
TO
174 /**
175 * Returns the names of this table
176 *
177 * @return string
178 */
c3fc2621 179 public static function getTableName() {
e501603b
TO
180 return self::$_tableName;
181 }
c3fc2621 182
e501603b
TO
183 /**
184 * Returns if this table needs to be logged
185 *
c3fc2621 186 * @return bool
e501603b 187 */
c3fc2621 188 public function getLog() {
e501603b
TO
189 return self::$_log;
190 }
c3fc2621 191
e501603b
TO
192 /**
193 * Returns the list of fields that can be imported
194 *
195 * @param bool $prefix
196 *
197 * @return array
198 */
c3fc2621
CW
199 public static function &import($prefix = FALSE) {
200 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'acl_cache', $prefix, []);
60808919 201 return $r;
e501603b 202 }
c3fc2621 203
e501603b
TO
204 /**
205 * Returns the list of fields that can be exported
206 *
207 * @param bool $prefix
208 *
209 * @return array
210 */
c3fc2621
CW
211 public static function &export($prefix = FALSE) {
212 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'acl_cache', $prefix, []);
60808919 213 return $r;
e501603b 214 }
c3fc2621 215
e7a6b91a
AS
216 /**
217 * Returns the list of indices
c3fc2621
CW
218 *
219 * @param bool $localize
220 *
221 * @return array
e7a6b91a
AS
222 */
223 public static function indices($localize = TRUE) {
c3fc2621
CW
224 $indices = [
225 'index_acl_id' => [
e7a6b91a 226 'name' => 'index_acl_id',
c3fc2621 227 'field' => [
e7a6b91a 228 0 => 'acl_id',
c3fc2621
CW
229 ],
230 'localizable' => FALSE,
e7a6b91a 231 'sig' => 'civicrm_acl_cache::0::acl_id',
c3fc2621 232 ],
1ec2637a 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 ],
c3fc2621 241 ];
e7a6b91a
AS
242 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
243 }
c3fc2621 244
e501603b 245}