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:ae8316157b30548661674486dac78c39)
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 'where' => 'civicrm_acl_contact_cache.id',
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 'where' => 'civicrm_acl_contact_cache.user_id',
108 'table_name' => 'civicrm_acl_contact_cache',
109 'entity' => 'ACLContactCache',
110 'bao' => 'CRM_Contact_DAO_ACLContactCache',
114 'name' => 'contact_id',
115 'type' => CRM_Utils_Type
::T_INT
,
116 'title' => ts('Contact ID'),
117 'description' => ts('FK to civicrm_contact'),
119 'where' => 'civicrm_acl_contact_cache.contact_id',
120 'table_name' => 'civicrm_acl_contact_cache',
121 'entity' => 'ACLContactCache',
122 'bao' => 'CRM_Contact_DAO_ACLContactCache',
124 'FKClassName' => 'CRM_Contact_DAO_Contact',
127 'name' => 'operation',
128 'type' => CRM_Utils_Type
::T_STRING
,
129 'title' => ts('Operation'),
130 'description' => ts('What operation does this user have permission on?'),
133 'size' => CRM_Utils_Type
::EIGHT
,
134 'where' => 'civicrm_acl_contact_cache.operation',
135 'table_name' => 'civicrm_acl_contact_cache',
136 'entity' => 'ACLContactCache',
137 'bao' => 'CRM_Contact_DAO_ACLContactCache',
142 'pseudoconstant' => [
143 '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;