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:97d9be5e13ece64b6c9ad1722d9bca68)
13 * Database access object for the ACLContactCache entity.
15 class CRM_Contact_DAO_ACLContactCache
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '3.1';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_acl_contact_cache';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
41 * FK to civicrm_contact (could be null for anon user)
48 * FK to civicrm_contact
55 * What operation does this user have permission on?
64 public function __construct() {
65 $this->__table
= 'civicrm_acl_contact_cache';
66 parent
::__construct();
70 * Returns localized title of this entity.
72 public static function getEntityTitle() {
73 return ts('ACLContact Caches');
77 * Returns foreign keys and entity references.
80 * [CRM_Core_Reference_Interface]
82 public static function getReferenceColumns() {
83 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
84 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
85 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
86 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
88 return Civi
::$statics[__CLASS__
]['links'];
92 * Returns all the column names of this table
96 public static function &fields() {
97 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
98 Civi
::$statics[__CLASS__
]['fields'] = [
101 'type' => CRM_Utils_Type
::T_INT
,
102 'title' => ts('ACL Contact Cache ID'),
103 'description' => ts('primary key'),
105 'where' => 'civicrm_acl_contact_cache.id',
106 'table_name' => 'civicrm_acl_contact_cache',
107 'entity' => 'ACLContactCache',
108 'bao' => 'CRM_Contact_DAO_ACLContactCache',
114 'type' => CRM_Utils_Type
::T_INT
,
115 'title' => ts('Contact ID'),
116 'description' => ts('FK to civicrm_contact (could be null for anon user)'),
117 'where' => 'civicrm_acl_contact_cache.user_id',
118 'table_name' => 'civicrm_acl_contact_cache',
119 'entity' => 'ACLContactCache',
120 'bao' => 'CRM_Contact_DAO_ACLContactCache',
125 'name' => 'contact_id',
126 'type' => CRM_Utils_Type
::T_INT
,
127 'title' => ts('Contact ID'),
128 'description' => ts('FK to civicrm_contact'),
130 'where' => 'civicrm_acl_contact_cache.contact_id',
131 'table_name' => 'civicrm_acl_contact_cache',
132 'entity' => 'ACLContactCache',
133 'bao' => 'CRM_Contact_DAO_ACLContactCache',
135 'FKClassName' => 'CRM_Contact_DAO_Contact',
139 'name' => 'operation',
140 'type' => CRM_Utils_Type
::T_STRING
,
141 'title' => ts('Operation'),
142 'description' => ts('What operation does this user have permission on?'),
145 'size' => CRM_Utils_Type
::EIGHT
,
146 'where' => 'civicrm_acl_contact_cache.operation',
147 'table_name' => 'civicrm_acl_contact_cache',
148 'entity' => 'ACLContactCache',
149 'bao' => 'CRM_Contact_DAO_ACLContactCache',
154 'pseudoconstant' => [
155 'callback' => 'CRM_ACL_BAO_ACL::operation',
160 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
162 return Civi
::$statics[__CLASS__
]['fields'];
166 * Return a mapping from field-name to the corresponding key (as used in fields()).
169 * Array(string $name => string $uniqueName).
171 public static function &fieldKeys() {
172 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
173 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
175 return Civi
::$statics[__CLASS__
]['fieldKeys'];
179 * Returns the names of this table
183 public static function getTableName() {
184 return self
::$_tableName;
188 * Returns if this table needs to be logged
192 public function getLog() {
197 * Returns the list of fields that can be imported
199 * @param bool $prefix
203 public static function &import($prefix = FALSE) {
204 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl_contact_cache', $prefix, []);
209 * Returns the list of fields that can be exported
211 * @param bool $prefix
215 public static function &export($prefix = FALSE) {
216 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl_contact_cache', $prefix, []);
221 * Returns the list of indices
223 * @param bool $localize
227 public static function indices($localize = TRUE) {
229 'UI_user_contact_operation' => [
230 'name' => 'UI_user_contact_operation',
236 'localizable' => FALSE,
238 'sig' => 'civicrm_acl_contact_cache::1::user_id::contact_id::operation',
241 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;