Merge pull request #8944 from totten/master-givi
[civicrm-core.git] / CRM / Core / DAO / Cache.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
6| Copyright CiviCRM LLC (c) 2004-2016 |
7+--------------------------------------------------------------------+
8| This file is a part of CiviCRM. |
9| |
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. |
13| |
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. |
18| |
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+--------------------------------------------------------------------+
26*/
27/**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2016
30 *
31 * Generated from xml/schema/CRM/Core/Cache.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
437fafcf 33 * (GenCodeChecksum:b145d7f1474d493c2df518be572bc56c)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
37class CRM_Core_DAO_Cache extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_cache';
e501603b
TO
44 /**
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
47 *
48 * @var boolean
49 */
50 static $_log = false;
51 /**
52 *
53 * @var int unsigned
54 */
55 public $id;
56 /**
57 * group name for cache element, useful in cleaning cache elements
58 *
59 * @var string
60 */
61 public $group_name;
62 /**
63 * Unique path name for cache element
64 *
65 * @var string
66 */
67 public $path;
68 /**
69 * data associated with this path
70 *
71 * @var longtext
72 */
73 public $data;
74 /**
75 * Component that this menu item belongs to
76 *
77 * @var int unsigned
78 */
79 public $component_id;
80 /**
81 * When was the cache item created
82 *
83 * @var datetime
84 */
85 public $created_date;
86 /**
87 * When should the cache item expire
88 *
89 * @var datetime
90 */
91 public $expired_date;
92 /**
93 * class constructor
94 *
95 * @return civicrm_cache
96 */
97 function __construct() {
98 $this->__table = 'civicrm_cache';
99 parent::__construct();
100 }
101 /**
102 * Returns foreign keys and entity references
103 *
104 * @return array
105 * [CRM_Core_Reference_Interface]
106 */
107 static function getReferenceColumns() {
346aaaba
TO
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']);
e501603b 112 }
346aaaba 113 return Civi::$statics[__CLASS__]['links'];
e501603b
TO
114 }
115 /**
116 * Returns all the column names of this table
117 *
118 * @return array
119 */
120 static function &fields() {
346aaaba
TO
121 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
122 Civi::$statics[__CLASS__]['fields'] = array(
e501603b
TO
123 'id' => array(
124 'name' => 'id',
125 'type' => CRM_Utils_Type::T_INT,
126 'required' => true,
127 ) ,
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',
133 'required' => true,
134 'maxlength' => 32,
135 'size' => CRM_Utils_Type::MEDIUM,
136 ) ,
137 'path' => array(
138 'name' => 'path',
139 'type' => CRM_Utils_Type::T_STRING,
140 'title' => ts('Path') ,
141 'description' => 'Unique path name for cache element',
142 'maxlength' => 255,
143 'size' => CRM_Utils_Type::HUGE,
144 ) ,
145 'data' => array(
146 'name' => 'data',
147 'type' => CRM_Utils_Type::T_LONGTEXT,
148 'title' => ts('Data') ,
149 'description' => 'data associated with this path',
150 ) ,
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',
156 'html' => array(
157 'type' => 'Select',
158 ) ,
159 'pseudoconstant' => array(
160 'table' => 'civicrm_component',
161 'keyColumn' => 'id',
162 'labelColumn' => 'name',
163 )
164 ) ,
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',
170 ) ,
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',
176 ) ,
177 );
346aaaba 178 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 179 }
346aaaba 180 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
181 }
182 /**
bd8e0b14 183 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
184 *
185 * @return array
bd8e0b14 186 * Array(string $name => string $uniqueName).
e501603b
TO
187 */
188 static function &fieldKeys() {
bd8e0b14
TO
189 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
190 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 191 }
bd8e0b14 192 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
193 }
194 /**
195 * Returns the names of this table
196 *
197 * @return string
198 */
199 static function getTableName() {
200 return self::$_tableName;
201 }
202 /**
203 * Returns if this table needs to be logged
204 *
205 * @return boolean
206 */
207 function getLog() {
208 return self::$_log;
209 }
210 /**
211 * Returns the list of fields that can be imported
212 *
213 * @param bool $prefix
214 *
215 * @return array
216 */
217 static function &import($prefix = false) {
60808919
TO
218 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'cache', $prefix, array());
219 return $r;
e501603b
TO
220 }
221 /**
222 * Returns the list of fields that can be exported
223 *
224 * @param bool $prefix
225 *
226 * @return array
227 */
228 static function &export($prefix = false) {
60808919
TO
229 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'cache', $prefix, array());
230 return $r;
e501603b
TO
231 }
232}