3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2016
31 * Generated from xml/schema/CRM/Core/Cache.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:b145d7f1474d493c2df518be572bc56c)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_Cache
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_cache';
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
57 * group name for cache element, useful in cleaning cache elements
63 * Unique path name for cache element
69 * data associated with this path
75 * Component that this menu item belongs to
81 * When was the cache item created
87 * When should the cache item expire
95 * @return civicrm_cache
97 function __construct() {
98 $this->__table
= 'civicrm_cache';
99 parent
::__construct();
102 * Returns foreign keys and entity references
105 * [CRM_Core_Reference_Interface]
107 static function getReferenceColumns() {
108 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
109 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
110 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'component_id', 'civicrm_component', 'id');
111 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
113 return Civi
::$statics[__CLASS__
]['links'];
116 * Returns all the column names of this table
120 static function &fields() {
121 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
122 Civi
::$statics[__CLASS__
]['fields'] = array(
125 'type' => CRM_Utils_Type
::T_INT
,
128 'group_name' => array(
129 'name' => 'group_name',
130 'type' => CRM_Utils_Type
::T_STRING
,
131 'title' => ts('Group Name') ,
132 'description' => 'group name for cache element, useful in cleaning cache elements',
135 'size' => CRM_Utils_Type
::MEDIUM
,
139 'type' => CRM_Utils_Type
::T_STRING
,
140 'title' => ts('Path') ,
141 'description' => 'Unique path name for cache element',
143 'size' => CRM_Utils_Type
::HUGE
,
147 'type' => CRM_Utils_Type
::T_LONGTEXT
,
148 'title' => ts('Data') ,
149 'description' => 'data associated with this path',
151 'component_id' => array(
152 'name' => 'component_id',
153 'type' => CRM_Utils_Type
::T_INT
,
154 'description' => 'Component that this menu item belongs to',
155 'FKClassName' => 'CRM_Core_DAO_Component',
159 'pseudoconstant' => array(
160 'table' => 'civicrm_component',
162 'labelColumn' => 'name',
165 'created_date' => array(
166 'name' => 'created_date',
167 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
168 'title' => ts('Created Date') ,
169 'description' => 'When was the cache item created',
171 'expired_date' => array(
172 'name' => 'expired_date',
173 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
174 'title' => ts('Expired Date') ,
175 'description' => 'When should the cache item expire',
178 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
180 return Civi
::$statics[__CLASS__
]['fields'];
183 * Return a mapping from field-name to the corresponding key (as used in fields()).
186 * Array(string $name => string $uniqueName).
188 static function &fieldKeys() {
189 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
190 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
192 return Civi
::$statics[__CLASS__
]['fieldKeys'];
195 * Returns the names of this table
199 static function getTableName() {
200 return self
::$_tableName;
203 * Returns if this table needs to be logged
211 * Returns the list of fields that can be imported
213 * @param bool $prefix
217 static function &import($prefix = false) {
218 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'cache', $prefix, array());
222 * Returns the list of fields that can be exported
224 * @param bool $prefix
228 static function &export($prefix = false) {
229 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'cache', $prefix, array());