5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/Cache.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:695d7ebea0e7103ff58dfbbff111dde6)
13 * Database access object for the Cache entity.
15 class CRM_Core_DAO_Cache
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_cache';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * group name for cache element, useful in cleaning cache elements
46 * Unique path name for cache element
53 * data associated with this path
60 * Component that this menu item belongs to
67 * When was the cache item created
74 * When should the cache item expire
83 public function __construct() {
84 $this->__table
= 'civicrm_cache';
85 parent
::__construct();
89 * Returns localized title of this entity.
91 public static function getEntityTitle() {
96 * Returns foreign keys and entity references.
99 * [CRM_Core_Reference_Interface]
101 public static function getReferenceColumns() {
102 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
103 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
104 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'component_id', 'civicrm_component', 'id');
105 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
107 return Civi
::$statics[__CLASS__
]['links'];
111 * Returns all the column names of this table
115 public static function &fields() {
116 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
117 Civi
::$statics[__CLASS__
]['fields'] = [
120 'type' => CRM_Utils_Type
::T_INT
,
121 'title' => ts('Cache ID'),
122 'description' => ts('Unique table ID'),
124 'where' => 'civicrm_cache.id',
125 'table_name' => 'civicrm_cache',
127 'bao' => 'CRM_Core_BAO_Cache',
132 'name' => 'group_name',
133 'type' => CRM_Utils_Type
::T_STRING
,
134 'title' => ts('Group Name'),
135 'description' => ts('group name for cache element, useful in cleaning cache elements'),
138 'size' => CRM_Utils_Type
::MEDIUM
,
139 'where' => 'civicrm_cache.group_name',
140 'table_name' => 'civicrm_cache',
142 'bao' => 'CRM_Core_BAO_Cache',
148 'type' => CRM_Utils_Type
::T_STRING
,
149 'title' => ts('Path'),
150 'description' => ts('Unique path name for cache element'),
152 'size' => CRM_Utils_Type
::HUGE
,
153 'where' => 'civicrm_cache.path',
154 'table_name' => 'civicrm_cache',
156 'bao' => 'CRM_Core_BAO_Cache',
162 'type' => CRM_Utils_Type
::T_LONGTEXT
,
163 'title' => ts('Data'),
164 'description' => ts('data associated with this path'),
165 'where' => 'civicrm_cache.data',
166 'table_name' => 'civicrm_cache',
168 'bao' => 'CRM_Core_BAO_Cache',
173 'name' => 'component_id',
174 'type' => CRM_Utils_Type
::T_INT
,
175 'title' => ts('Component ID'),
176 'description' => ts('Component that this menu item belongs to'),
177 'where' => 'civicrm_cache.component_id',
178 'table_name' => 'civicrm_cache',
180 'bao' => 'CRM_Core_BAO_Cache',
182 'FKClassName' => 'CRM_Core_DAO_Component',
186 'pseudoconstant' => [
187 'table' => 'civicrm_component',
189 'labelColumn' => 'name',
194 'name' => 'created_date',
195 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
196 'title' => ts('Created Date'),
197 'description' => ts('When was the cache item created'),
198 'where' => 'civicrm_cache.created_date',
199 'default' => 'CURRENT_TIMESTAMP',
200 'table_name' => 'civicrm_cache',
202 'bao' => 'CRM_Core_BAO_Cache',
207 'name' => 'expired_date',
208 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
209 'title' => ts('Expired Date'),
210 'description' => ts('When should the cache item expire'),
212 'where' => 'civicrm_cache.expired_date',
214 'table_name' => 'civicrm_cache',
216 'bao' => 'CRM_Core_BAO_Cache',
221 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
223 return Civi
::$statics[__CLASS__
]['fields'];
227 * Return a mapping from field-name to the corresponding key (as used in fields()).
230 * Array(string $name => string $uniqueName).
232 public static function &fieldKeys() {
233 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
234 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
236 return Civi
::$statics[__CLASS__
]['fieldKeys'];
240 * Returns the names of this table
244 public static function getTableName() {
245 return self
::$_tableName;
249 * Returns if this table needs to be logged
253 public function getLog() {
258 * Returns the list of fields that can be imported
260 * @param bool $prefix
264 public static function &import($prefix = FALSE) {
265 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'cache', $prefix, []);
270 * Returns the list of fields that can be exported
272 * @param bool $prefix
276 public static function &export($prefix = FALSE) {
277 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'cache', $prefix, []);
282 * Returns the list of indices
284 * @param bool $localize
288 public static function indices($localize = TRUE) {
290 'UI_group_path_date' => [
291 'name' => 'UI_group_path_date',
297 'localizable' => FALSE,
299 'sig' => 'civicrm_cache::1::group_name::path::created_date',
302 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;