5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Contact/ACLContactCache.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:ab40fa26e037ef4897359d3c288d42b8)
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 foreign keys and entity references.
71 * [CRM_Core_Reference_Interface]
73 public static function getReferenceColumns() {
74 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
75 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
76 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
77 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
79 return Civi
::$statics[__CLASS__
]['links'];
83 * Returns all the column names of this table
87 public static function &fields() {
88 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
89 Civi
::$statics[__CLASS__
]['fields'] = [
92 'type' => CRM_Utils_Type
::T_INT
,
93 'title' => ts('ACL Contact Cache ID'),
94 'description' => ts('primary key'),
96 'table_name' => 'civicrm_acl_contact_cache',
97 'entity' => 'ACLContactCache',
98 'bao' => 'CRM_Contact_DAO_ACLContactCache',
103 'type' => CRM_Utils_Type
::T_INT
,
104 'title' => ts('Contact ID'),
105 'description' => ts('FK to civicrm_contact (could be null for anon user)'),
106 'table_name' => 'civicrm_acl_contact_cache',
107 'entity' => 'ACLContactCache',
108 'bao' => 'CRM_Contact_DAO_ACLContactCache',
112 'name' => 'contact_id',
113 'type' => CRM_Utils_Type
::T_INT
,
114 'title' => ts('Contact ID'),
115 'description' => ts('FK to civicrm_contact'),
117 'table_name' => 'civicrm_acl_contact_cache',
118 'entity' => 'ACLContactCache',
119 'bao' => 'CRM_Contact_DAO_ACLContactCache',
121 'FKClassName' => 'CRM_Contact_DAO_Contact',
124 'name' => 'operation',
125 'type' => CRM_Utils_Type
::T_STRING
,
126 'title' => ts('Operation'),
127 'description' => ts('What operation does this user have permission on?'),
130 'size' => CRM_Utils_Type
::EIGHT
,
131 'table_name' => 'civicrm_acl_contact_cache',
132 'entity' => 'ACLContactCache',
133 'bao' => 'CRM_Contact_DAO_ACLContactCache',
138 'pseudoconstant' => [
139 'callback' => 'CRM_ACL_BAO_ACL::operation',
143 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
145 return Civi
::$statics[__CLASS__
]['fields'];
149 * Return a mapping from field-name to the corresponding key (as used in fields()).
152 * Array(string $name => string $uniqueName).
154 public static function &fieldKeys() {
155 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
156 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
158 return Civi
::$statics[__CLASS__
]['fieldKeys'];
162 * Returns the names of this table
166 public static function getTableName() {
167 return self
::$_tableName;
171 * Returns if this table needs to be logged
175 public function getLog() {
180 * Returns the list of fields that can be imported
182 * @param bool $prefix
186 public static function &import($prefix = FALSE) {
187 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl_contact_cache', $prefix, []);
192 * Returns the list of fields that can be exported
194 * @param bool $prefix
198 public static function &export($prefix = FALSE) {
199 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl_contact_cache', $prefix, []);
204 * Returns the list of indices
206 * @param bool $localize
210 public static function indices($localize = TRUE) {
212 'UI_user_contact_operation' => [
213 'name' => 'UI_user_contact_operation',
219 'localizable' => FALSE,
221 'sig' => 'civicrm_acl_contact_cache::1::user_id::contact_id::operation',
224 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;