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:4eaf1e99ce247c430fc280cc6ce68538)
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.
73 * Whether to return the plural version of the title.
75 public static function getEntityTitle($plural = FALSE) {
76 return $plural ?
ts('ACLContact Caches') : ts('ACLContact Cache');
80 * Returns all the column names of this table
84 public static function &fields() {
85 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
86 Civi
::$statics[__CLASS__
]['fields'] = [
89 'type' => CRM_Utils_Type
::T_INT
,
90 'title' => ts('ACL Contact Cache ID'),
91 'description' => ts('primary key'),
93 'where' => 'civicrm_acl_contact_cache.id',
94 'table_name' => 'civicrm_acl_contact_cache',
95 'entity' => 'ACLContactCache',
96 'bao' => 'CRM_Contact_DAO_ACLContactCache',
102 'type' => CRM_Utils_Type
::T_INT
,
103 'title' => ts('Contact ID'),
104 'description' => ts('FK to civicrm_contact (could be null for anon user)'),
105 'where' => 'civicrm_acl_contact_cache.user_id',
106 'table_name' => 'civicrm_acl_contact_cache',
107 'entity' => 'ACLContactCache',
108 'bao' => 'CRM_Contact_DAO_ACLContactCache',
113 'name' => 'contact_id',
114 'type' => CRM_Utils_Type
::T_INT
,
115 'title' => ts('Contact ID'),
116 'description' => ts('FK to civicrm_contact'),
118 'where' => 'civicrm_acl_contact_cache.contact_id',
119 'table_name' => 'civicrm_acl_contact_cache',
120 'entity' => 'ACLContactCache',
121 'bao' => 'CRM_Contact_DAO_ACLContactCache',
126 'name' => 'operation',
127 'type' => CRM_Utils_Type
::T_STRING
,
128 'title' => ts('Operation'),
129 'description' => ts('What operation does this user have permission on?'),
132 'size' => CRM_Utils_Type
::EIGHT
,
133 'where' => 'civicrm_acl_contact_cache.operation',
134 'table_name' => 'civicrm_acl_contact_cache',
135 'entity' => 'ACLContactCache',
136 'bao' => 'CRM_Contact_DAO_ACLContactCache',
141 'pseudoconstant' => [
142 'callback' => 'CRM_ACL_BAO_ACL::operation',
147 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
149 return Civi
::$statics[__CLASS__
]['fields'];
153 * Return a mapping from field-name to the corresponding key (as used in fields()).
156 * Array(string $name => string $uniqueName).
158 public static function &fieldKeys() {
159 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
160 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
162 return Civi
::$statics[__CLASS__
]['fieldKeys'];
166 * Returns the names of this table
170 public static function getTableName() {
171 return self
::$_tableName;
175 * Returns if this table needs to be logged
179 public function getLog() {
184 * Returns the list of fields that can be imported
186 * @param bool $prefix
190 public static function &import($prefix = FALSE) {
191 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl_contact_cache', $prefix, []);
196 * Returns the list of fields that can be exported
198 * @param bool $prefix
202 public static function &export($prefix = FALSE) {
203 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl_contact_cache', $prefix, []);
208 * Returns the list of indices
210 * @param bool $localize
214 public static function indices($localize = TRUE) {
216 'UI_user_contact_operation' => [
217 'name' => 'UI_user_contact_operation',
223 'localizable' => FALSE,
225 'sig' => 'civicrm_acl_contact_cache::1::user_id::contact_id::operation',
228 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;