Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
ca5cec67 | 5 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Contact/ACLContactCache.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
a9d0587b | 9 | * (GenCodeChecksum:b99253b18e66856d4b6d914f2669fa30) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the ACLContactCache entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Contact_DAO_ACLContactCache 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_contact_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 | * primary key | |
33 | * | |
e6ca0a57 | 34 | * @var int |
e501603b TO |
35 | */ |
36 | public $id; | |
c3fc2621 | 37 | |
e501603b TO |
38 | /** |
39 | * FK to civicrm_contact (could be null for anon user) | |
40 | * | |
e6ca0a57 | 41 | * @var int |
e501603b TO |
42 | */ |
43 | public $user_id; | |
c3fc2621 | 44 | |
e501603b TO |
45 | /** |
46 | * FK to civicrm_contact | |
47 | * | |
e6ca0a57 | 48 | * @var int |
e501603b TO |
49 | */ |
50 | public $contact_id; | |
c3fc2621 | 51 | |
e501603b TO |
52 | /** |
53 | * What operation does this user have permission on? | |
54 | * | |
55 | * @var string | |
56 | */ | |
57 | public $operation; | |
c3fc2621 | 58 | |
e501603b | 59 | /** |
f41f0342 | 60 | * Class constructor. |
e501603b | 61 | */ |
c3fc2621 | 62 | public function __construct() { |
e501603b TO |
63 | $this->__table = 'civicrm_acl_contact_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('ACLContact Caches'); | |
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'])) { |
fa45b5b9 | 82 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 | 83 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id'); |
346aaaba | 84 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 85 | } |
346aaaba | 86 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 87 | } |
c3fc2621 | 88 | |
e501603b TO |
89 | /** |
90 | * Returns all the column names of this table | |
91 | * | |
92 | * @return array | |
93 | */ | |
c3fc2621 | 94 | public static function &fields() { |
346aaaba | 95 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
96 | Civi::$statics[__CLASS__]['fields'] = [ |
97 | 'id' => [ | |
e501603b TO |
98 | 'name' => 'id', |
99 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 100 | 'title' => ts('ACL Contact Cache ID'), |
215b423e | 101 | 'description' => ts('primary key'), |
c3fc2621 | 102 | 'required' => TRUE, |
a36434b9 | 103 | 'where' => 'civicrm_acl_contact_cache.id', |
522a26c9 | 104 | 'table_name' => 'civicrm_acl_contact_cache', |
105 | 'entity' => 'ACLContactCache', | |
106 | 'bao' => 'CRM_Contact_DAO_ACLContactCache', | |
6a7e5e5d | 107 | 'localizable' => 0, |
a9d0587b | 108 | 'add' => '3.1', |
c3fc2621 CW |
109 | ], |
110 | 'user_id' => [ | |
e501603b TO |
111 | 'name' => 'user_id', |
112 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 113 | 'title' => ts('Contact ID'), |
215b423e | 114 | 'description' => ts('FK to civicrm_contact (could be null for anon user)'), |
a36434b9 | 115 | 'where' => 'civicrm_acl_contact_cache.user_id', |
522a26c9 | 116 | 'table_name' => 'civicrm_acl_contact_cache', |
117 | 'entity' => 'ACLContactCache', | |
118 | 'bao' => 'CRM_Contact_DAO_ACLContactCache', | |
6a7e5e5d | 119 | 'localizable' => 0, |
a9d0587b | 120 | 'add' => '3.1', |
c3fc2621 CW |
121 | ], |
122 | 'contact_id' => [ | |
e501603b TO |
123 | 'name' => 'contact_id', |
124 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 125 | 'title' => ts('Contact ID'), |
215b423e | 126 | 'description' => ts('FK to civicrm_contact'), |
c3fc2621 | 127 | 'required' => TRUE, |
a36434b9 | 128 | 'where' => 'civicrm_acl_contact_cache.contact_id', |
522a26c9 | 129 | 'table_name' => 'civicrm_acl_contact_cache', |
130 | 'entity' => 'ACLContactCache', | |
131 | 'bao' => 'CRM_Contact_DAO_ACLContactCache', | |
6a7e5e5d | 132 | 'localizable' => 0, |
e501603b | 133 | 'FKClassName' => 'CRM_Contact_DAO_Contact', |
a9d0587b | 134 | 'add' => '3.1', |
c3fc2621 CW |
135 | ], |
136 | 'operation' => [ | |
e501603b TO |
137 | 'name' => 'operation', |
138 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 139 | 'title' => ts('Operation'), |
215b423e | 140 | 'description' => ts('What operation does this user have permission on?'), |
c3fc2621 | 141 | 'required' => TRUE, |
e501603b TO |
142 | 'maxlength' => 8, |
143 | 'size' => CRM_Utils_Type::EIGHT, | |
a36434b9 | 144 | 'where' => 'civicrm_acl_contact_cache.operation', |
522a26c9 | 145 | 'table_name' => 'civicrm_acl_contact_cache', |
146 | 'entity' => 'ACLContactCache', | |
147 | 'bao' => 'CRM_Contact_DAO_ACLContactCache', | |
6a7e5e5d | 148 | 'localizable' => 0, |
c3fc2621 | 149 | 'html' => [ |
e501603b | 150 | 'type' => 'Select', |
c3fc2621 CW |
151 | ], |
152 | 'pseudoconstant' => [ | |
e501603b | 153 | 'callback' => 'CRM_ACL_BAO_ACL::operation', |
e6ca0a57 | 154 | ], |
a9d0587b | 155 | 'add' => '1.6', |
c3fc2621 CW |
156 | ], |
157 | ]; | |
346aaaba | 158 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 159 | } |
346aaaba | 160 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 161 | } |
c3fc2621 | 162 | |
e501603b | 163 | /** |
bd8e0b14 | 164 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
165 | * |
166 | * @return array | |
bd8e0b14 | 167 | * Array(string $name => string $uniqueName). |
e501603b | 168 | */ |
c3fc2621 | 169 | public static function &fieldKeys() { |
bd8e0b14 TO |
170 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
171 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 172 | } |
bd8e0b14 | 173 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 174 | } |
c3fc2621 | 175 | |
e501603b TO |
176 | /** |
177 | * Returns the names of this table | |
178 | * | |
179 | * @return string | |
180 | */ | |
c3fc2621 | 181 | public static function getTableName() { |
e501603b TO |
182 | return self::$_tableName; |
183 | } | |
c3fc2621 | 184 | |
e501603b TO |
185 | /** |
186 | * Returns if this table needs to be logged | |
187 | * | |
c3fc2621 | 188 | * @return bool |
e501603b | 189 | */ |
c3fc2621 | 190 | public function getLog() { |
e501603b TO |
191 | return self::$_log; |
192 | } | |
c3fc2621 | 193 | |
e501603b TO |
194 | /** |
195 | * Returns the list of fields that can be imported | |
196 | * | |
197 | * @param bool $prefix | |
198 | * | |
199 | * @return array | |
200 | */ | |
c3fc2621 CW |
201 | public static function &import($prefix = FALSE) { |
202 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'acl_contact_cache', $prefix, []); | |
60808919 | 203 | return $r; |
e501603b | 204 | } |
c3fc2621 | 205 | |
e501603b TO |
206 | /** |
207 | * Returns the list of fields that can be exported | |
208 | * | |
209 | * @param bool $prefix | |
210 | * | |
211 | * @return array | |
212 | */ | |
c3fc2621 CW |
213 | public static function &export($prefix = FALSE) { |
214 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'acl_contact_cache', $prefix, []); | |
60808919 | 215 | return $r; |
e501603b | 216 | } |
c3fc2621 | 217 | |
e7a6b91a AS |
218 | /** |
219 | * Returns the list of indices | |
c3fc2621 CW |
220 | * |
221 | * @param bool $localize | |
222 | * | |
223 | * @return array | |
e7a6b91a AS |
224 | */ |
225 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
226 | $indices = [ |
227 | 'UI_user_contact_operation' => [ | |
e7a6b91a | 228 | 'name' => 'UI_user_contact_operation', |
c3fc2621 | 229 | 'field' => [ |
e7a6b91a AS |
230 | 0 => 'user_id', |
231 | 1 => 'contact_id', | |
232 | 2 => 'operation', | |
c3fc2621 CW |
233 | ], |
234 | 'localizable' => FALSE, | |
235 | 'unique' => TRUE, | |
e7a6b91a | 236 | 'sig' => 'civicrm_acl_contact_cache::1::user_id::contact_id::operation', |
c3fc2621 CW |
237 | ], |
238 | ]; | |
e7a6b91a AS |
239 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
240 | } | |
c3fc2621 | 241 | |
e501603b | 242 | } |