5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/ACL/ACLCache.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:a7bccfc35714fdcf0fdb6f4cd24842bd)
13 * Database access object for the ACLCache entity.
15 class CRM_ACL_DAO_ACLCache
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_acl_cache';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * Foreign Key to Contact
53 * When was this cache entry last modified
57 public $modified_date;
62 public function __construct() {
63 $this->__table
= 'civicrm_acl_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 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'acl_id', 'civicrm_acl', '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('Cache ID'),
95 'description' => ts('Unique table ID'),
97 'where' => 'civicrm_acl_cache.id',
98 'table_name' => 'civicrm_acl_cache',
99 'entity' => 'ACLCache',
100 'bao' => 'CRM_ACL_DAO_ACLCache',
104 'name' => 'contact_id',
105 'type' => CRM_Utils_Type
::T_INT
,
106 'title' => ts('Cache Contact'),
107 'description' => ts('Foreign Key to Contact'),
108 'where' => 'civicrm_acl_cache.contact_id',
109 'table_name' => 'civicrm_acl_cache',
110 'entity' => 'ACLCache',
111 'bao' => 'CRM_ACL_DAO_ACLCache',
113 'FKClassName' => 'CRM_Contact_DAO_Contact',
117 'type' => CRM_Utils_Type
::T_INT
,
118 'title' => ts('Cache ACL'),
119 'description' => ts('Foreign Key to ACL'),
121 'where' => 'civicrm_acl_cache.acl_id',
122 'table_name' => 'civicrm_acl_cache',
123 'entity' => 'ACLCache',
124 'bao' => 'CRM_ACL_DAO_ACLCache',
126 'FKClassName' => 'CRM_ACL_DAO_ACL',
129 'name' => 'modified_date',
130 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
131 'title' => ts('Cache Modified Date'),
132 'description' => ts('When was this cache entry last modified'),
134 'where' => 'civicrm_acl_cache.modified_date',
135 'table_name' => 'civicrm_acl_cache',
136 'entity' => 'ACLCache',
137 'bao' => 'CRM_ACL_DAO_ACLCache',
141 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
143 return Civi
::$statics[__CLASS__
]['fields'];
147 * Return a mapping from field-name to the corresponding key (as used in fields()).
150 * Array(string $name => string $uniqueName).
152 public static function &fieldKeys() {
153 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
154 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
156 return Civi
::$statics[__CLASS__
]['fieldKeys'];
160 * Returns the names of this table
164 public static function getTableName() {
165 return self
::$_tableName;
169 * Returns if this table needs to be logged
173 public function getLog() {
178 * Returns the list of fields that can be imported
180 * @param bool $prefix
184 public static function &import($prefix = FALSE) {
185 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'acl_cache', $prefix, []);
190 * Returns the list of fields that can be exported
192 * @param bool $prefix
196 public static function &export($prefix = FALSE) {
197 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'acl_cache', $prefix, []);
202 * Returns the list of indices
204 * @param bool $localize
208 public static function indices($localize = TRUE) {
211 'name' => 'index_acl_id',
215 'localizable' => FALSE,
216 'sig' => 'civicrm_acl_cache::0::acl_id',
219 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;