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:b9913f6181f2b09c71b99f8c41d65c1b)
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;
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
43 * FK to civicrm_contact (could be null for anon user)
45 * @var int|string|null
46 * (SQL type: int unsigned)
47 * Note that values will be retrieved from the database as a string.
52 * FK to civicrm_contact
55 * (SQL type: int unsigned)
56 * Note that values will be retrieved from the database as a string.
61 * What operation does this user have permission on?
64 * (SQL type: varchar(8))
65 * Note that values will be retrieved from the database as a string.
72 public function __construct() {
73 $this->__table
= 'civicrm_acl_contact_cache';
74 parent
::__construct();
78 * Returns localized title of this entity.
81 * Whether to return the plural version of the title.
83 public static function getEntityTitle($plural = FALSE) {
84 return $plural ?
ts('ACLContact Caches') : ts('ACLContact Cache');
88 * Returns all the column names of this table
92 public static function &fields() {
93 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
94 Civi
::$statics[__CLASS__
]['fields'] = [
97 'type' => CRM_Utils_Type
::T_INT
,
98 'title' => ts('ACL Contact Cache ID'),
99 'description' => ts('primary key'),
101 'where' => 'civicrm_acl_contact_cache.id',
102 'table_name' => 'civicrm_acl_contact_cache',
103 'entity' => 'ACLContactCache',
104 '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',
136 'label' => ts("Contact"),
141 'name' => 'operation',
142 'type' => CRM_Utils_Type
::T_STRING
,
143 'title' => ts('Operation'),
144 'description' => ts('What operation does this user have permission on?'),
147 'size' => CRM_Utils_Type
::EIGHT
,
148 'where' => 'civicrm_acl_contact_cache.operation',
149 'table_name' => 'civicrm_acl_contact_cache',
150 'entity' => 'ACLContactCache',
151 'bao' => 'CRM_Contact_DAO_ACLContactCache',
156 'pseudoconstant' => [
157 'callback' => 'CRM_ACL_BAO_ACL::operation',
162 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
164 return Civi
::$statics[__CLASS__
]['fields'];
168 * Return a mapping from field-name to the corresponding key (as used in fields()).
171 * Array(string $name => string $uniqueName).
173 public static function &fieldKeys() {
174 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
175 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
177 return Civi
::$statics[__CLASS__
]['fieldKeys'];
181 * Returns the names of this table
185 public static function getTableName() {
186 return self
::$_tableName;
190 * Returns if this table needs to be logged
194 public function getLog() {
199 * Returns the list of fields that can be imported
201 * @param bool $prefix
205 public static function &import($prefix = FALSE) {
206 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl_contact_cache', $prefix, []);
211 * Returns the list of fields that can be exported
213 * @param bool $prefix
217 public static function &export($prefix = FALSE) {
218 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl_contact_cache', $prefix, []);
223 * Returns the list of indices
225 * @param bool $localize
229 public static function indices($localize = TRUE) {
231 'UI_user_contact_operation' => [
232 'name' => 'UI_user_contact_operation',
238 'localizable' => FALSE,
240 'sig' => 'civicrm_acl_contact_cache::1::user_id::contact_id::operation',
243 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;