5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Contact/ACLContactCache.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:b99253b18e66856d4b6d914f2669fa30)
13 * Database access object for the ACLContactCache entity.
15 class CRM_Contact_DAO_ACLContactCache
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_acl_contact_cache';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * FK to civicrm_contact (could be null for anon user)
46 * FK to civicrm_contact
53 * What operation does this user have permission on?
62 public function __construct() {
63 $this->__table
= 'civicrm_acl_contact_cache';
64 parent
::__construct();
68 * Returns localized title of this entity.
70 public static function getEntityTitle() {
71 return ts('ACLContact Caches');
75 * Returns foreign keys and entity references.
78 * [CRM_Core_Reference_Interface]
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 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
86 return Civi
::$statics[__CLASS__
]['links'];
90 * Returns all the column names of this table
94 public static function &fields() {
95 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
96 Civi
::$statics[__CLASS__
]['fields'] = [
99 'type' => CRM_Utils_Type
::T_INT
,
100 'title' => ts('ACL Contact Cache ID'),
101 'description' => ts('primary key'),
103 'where' => 'civicrm_acl_contact_cache.id',
104 'table_name' => 'civicrm_acl_contact_cache',
105 'entity' => 'ACLContactCache',
106 'bao' => 'CRM_Contact_DAO_ACLContactCache',
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('Contact ID'),
114 'description' => ts('FK to civicrm_contact (could be null for anon user)'),
115 'where' => 'civicrm_acl_contact_cache.user_id',
116 'table_name' => 'civicrm_acl_contact_cache',
117 'entity' => 'ACLContactCache',
118 'bao' => 'CRM_Contact_DAO_ACLContactCache',
123 'name' => 'contact_id',
124 'type' => CRM_Utils_Type
::T_INT
,
125 'title' => ts('Contact ID'),
126 'description' => ts('FK to civicrm_contact'),
128 'where' => 'civicrm_acl_contact_cache.contact_id',
129 'table_name' => 'civicrm_acl_contact_cache',
130 'entity' => 'ACLContactCache',
131 'bao' => 'CRM_Contact_DAO_ACLContactCache',
133 'FKClassName' => 'CRM_Contact_DAO_Contact',
137 'name' => 'operation',
138 'type' => CRM_Utils_Type
::T_STRING
,
139 'title' => ts('Operation'),
140 'description' => ts('What operation does this user have permission on?'),
143 'size' => CRM_Utils_Type
::EIGHT
,
144 'where' => 'civicrm_acl_contact_cache.operation',
145 'table_name' => 'civicrm_acl_contact_cache',
146 'entity' => 'ACLContactCache',
147 'bao' => 'CRM_Contact_DAO_ACLContactCache',
152 'pseudoconstant' => [
153 'callback' => 'CRM_ACL_BAO_ACL::operation',
158 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
160 return Civi
::$statics[__CLASS__
]['fields'];
164 * Return a mapping from field-name to the corresponding key (as used in fields()).
167 * Array(string $name => string $uniqueName).
169 public static function &fieldKeys() {
170 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
171 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
173 return Civi
::$statics[__CLASS__
]['fieldKeys'];
177 * Returns the names of this table
181 public static function getTableName() {
182 return self
::$_tableName;
186 * Returns if this table needs to be logged
190 public function getLog() {
195 * Returns the list of fields that can be imported
197 * @param bool $prefix
201 public static function &import($prefix = FALSE) {
202 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl_contact_cache', $prefix, []);
207 * Returns the list of fields that can be exported
209 * @param bool $prefix
213 public static function &export($prefix = FALSE) {
214 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl_contact_cache', $prefix, []);
219 * Returns the list of indices
221 * @param bool $localize
225 public static function indices($localize = TRUE) {
227 'UI_user_contact_operation' => [
228 'name' => 'UI_user_contact_operation',
234 'localizable' => FALSE,
236 'sig' => 'civicrm_acl_contact_cache::1::user_id::contact_id::operation',
239 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;