5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/Cache.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:0683b150dd60e1ec9b53c00957137a27)
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 static $_tableName = 'civicrm_cache';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
37 * group name for cache element, useful in cleaning cache elements
44 * Unique path name for cache element
51 * data associated with this path
58 * Component that this menu item belongs to
65 * When was the cache item created
72 * When should the cache item expire
81 public function __construct() {
82 $this->__table
= 'civicrm_cache';
83 parent
::__construct();
87 * Returns foreign keys and entity references.
90 * [CRM_Core_Reference_Interface]
92 public static function getReferenceColumns() {
93 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
94 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
95 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'component_id', 'civicrm_component', 'id');
96 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
98 return Civi
::$statics[__CLASS__
]['links'];
102 * Returns all the column names of this table
106 public static function &fields() {
107 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
108 Civi
::$statics[__CLASS__
]['fields'] = [
111 'type' => CRM_Utils_Type
::T_INT
,
113 'table_name' => 'civicrm_cache',
115 'bao' => 'CRM_Core_BAO_Cache',
119 'name' => 'group_name',
120 'type' => CRM_Utils_Type
::T_STRING
,
121 'title' => ts('Group Name'),
122 'description' => ts('group name for cache element, useful in cleaning cache elements'),
125 'size' => CRM_Utils_Type
::MEDIUM
,
126 'table_name' => 'civicrm_cache',
128 'bao' => 'CRM_Core_BAO_Cache',
133 'type' => CRM_Utils_Type
::T_STRING
,
134 'title' => ts('Path'),
135 'description' => ts('Unique path name for cache element'),
137 'size' => CRM_Utils_Type
::HUGE
,
138 'table_name' => 'civicrm_cache',
140 'bao' => 'CRM_Core_BAO_Cache',
145 'type' => CRM_Utils_Type
::T_LONGTEXT
,
146 'title' => ts('Data'),
147 'description' => ts('data associated with this path'),
148 'table_name' => 'civicrm_cache',
150 'bao' => 'CRM_Core_BAO_Cache',
154 'name' => 'component_id',
155 'type' => CRM_Utils_Type
::T_INT
,
156 'description' => ts('Component that this menu item belongs to'),
157 'table_name' => 'civicrm_cache',
159 'bao' => 'CRM_Core_BAO_Cache',
161 'FKClassName' => 'CRM_Core_DAO_Component',
165 'pseudoconstant' => [
166 'table' => 'civicrm_component',
168 'labelColumn' => 'name',
172 'name' => 'created_date',
173 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
174 'title' => ts('Created Date'),
175 'description' => ts('When was the cache item created'),
176 'default' => 'CURRENT_TIMESTAMP',
177 'table_name' => 'civicrm_cache',
179 'bao' => 'CRM_Core_BAO_Cache',
183 'name' => 'expired_date',
184 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
185 'title' => ts('Expired Date'),
186 'description' => ts('When should the cache item expire'),
189 'table_name' => 'civicrm_cache',
191 'bao' => 'CRM_Core_BAO_Cache',
195 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
197 return Civi
::$statics[__CLASS__
]['fields'];
201 * Return a mapping from field-name to the corresponding key (as used in fields()).
204 * Array(string $name => string $uniqueName).
206 public static function &fieldKeys() {
207 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
208 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
210 return Civi
::$statics[__CLASS__
]['fieldKeys'];
214 * Returns the names of this table
218 public static function getTableName() {
219 return self
::$_tableName;
223 * Returns if this table needs to be logged
227 public function getLog() {
232 * Returns the list of fields that can be imported
234 * @param bool $prefix
238 public static function &import($prefix = FALSE) {
239 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'cache', $prefix, []);
244 * Returns the list of fields that can be exported
246 * @param bool $prefix
250 public static function &export($prefix = FALSE) {
251 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'cache', $prefix, []);
256 * Returns the list of indices
258 * @param bool $localize
262 public static function indices($localize = TRUE) {
264 'UI_group_path_date' => [
265 'name' => 'UI_group_path_date',
271 'localizable' => FALSE,
273 'sig' => 'civicrm_cache::1::group_name::path::created_date',
276 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;