5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Contact/ACLContactCache.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:4bb9eaae5704bfc98c258aa2f2130f5c)
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 static $_tableName = 'civicrm_acl_contact_cache';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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(), 'user_id', 'civicrm_contact', 'id');
77 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
78 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
80 return Civi
::$statics[__CLASS__
]['links'];
84 * Returns all the column names of this table
88 public static function &fields() {
89 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
90 Civi
::$statics[__CLASS__
]['fields'] = [
93 'type' => CRM_Utils_Type
::T_INT
,
94 'title' => ts('ACL Contact Cache ID'),
95 'description' => ts('primary key'),
97 'table_name' => 'civicrm_acl_contact_cache',
98 'entity' => 'ACLContactCache',
99 'bao' => 'CRM_Contact_DAO_ACLContactCache',
104 'type' => CRM_Utils_Type
::T_INT
,
105 'title' => ts('Contact ID'),
106 'description' => ts('FK to civicrm_contact (could be null for anon user)'),
107 'table_name' => 'civicrm_acl_contact_cache',
108 'entity' => 'ACLContactCache',
109 'bao' => 'CRM_Contact_DAO_ACLContactCache',
111 'FKClassName' => 'CRM_Contact_DAO_Contact',
114 'name' => 'contact_id',
115 'type' => CRM_Utils_Type
::T_INT
,
116 'title' => ts('Contact ID'),
117 'description' => ts('FK to civicrm_contact'),
119 'table_name' => 'civicrm_acl_contact_cache',
120 'entity' => 'ACLContactCache',
121 'bao' => 'CRM_Contact_DAO_ACLContactCache',
123 'FKClassName' => 'CRM_Contact_DAO_Contact',
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 'table_name' => 'civicrm_acl_contact_cache',
134 'entity' => 'ACLContactCache',
135 'bao' => 'CRM_Contact_DAO_ACLContactCache',
140 'pseudoconstant' => [
141 'callback' => 'CRM_ACL_BAO_ACL::operation',
145 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
147 return Civi
::$statics[__CLASS__
]['fields'];
151 * Return a mapping from field-name to the corresponding key (as used in fields()).
154 * Array(string $name => string $uniqueName).
156 public static function &fieldKeys() {
157 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
158 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
160 return Civi
::$statics[__CLASS__
]['fieldKeys'];
164 * Returns the names of this table
168 public static function getTableName() {
169 return self
::$_tableName;
173 * Returns if this table needs to be logged
177 public function getLog() {
182 * Returns the list of fields that can be imported
184 * @param bool $prefix
188 public static function &import($prefix = FALSE) {
189 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl_contact_cache', $prefix, []);
194 * Returns the list of fields that can be exported
196 * @param bool $prefix
200 public static function &export($prefix = FALSE) {
201 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl_contact_cache', $prefix, []);
206 * Returns the list of indices
208 * @param bool $localize
212 public static function indices($localize = TRUE) {
214 'UI_user_contact_operation' => [
215 'name' => 'UI_user_contact_operation',
221 'localizable' => FALSE,
223 'sig' => 'civicrm_acl_contact_cache::1::user_id::contact_id::operation',
226 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;