Update Copywrite year to be 2019
[civicrm-core.git] / CRM / Core / DAO / PrevNextCache.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Core/PrevNextCache.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:ec5d04442cf8976a3163cabeb3ba433c)
10 */
11
12 /**
13 * Database access object for the PrevNextCache entity.
14 */
15 class CRM_Core_DAO_PrevNextCache extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_prevnext_cache';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 static $_log = FALSE;
30
31 /**
32 * @var int unsigned
33 */
34 public $id;
35
36 /**
37 * physical tablename for entity being joined to discount, e.g. civicrm_event
38 *
39 * @var string
40 */
41 public $entity_table;
42
43 /**
44 * FK to entity table specified in entity_table column.
45 *
46 * @var int unsigned
47 */
48 public $entity_id1;
49
50 /**
51 * FK to entity table specified in entity_table column.
52 *
53 * @var int unsigned
54 */
55 public $entity_id2;
56
57 /**
58 * Unique path name for cache element of the searched item
59 *
60 * @var string
61 */
62 public $cacheKey;
63
64 /**
65 * cached snapshot of the serialized data
66 *
67 * @var longtext
68 */
69 public $data;
70
71 /**
72 * @var boolean
73 */
74 public $is_selected;
75
76 /**
77 * Class constructor.
78 */
79 public function __construct() {
80 $this->__table = 'civicrm_prevnext_cache';
81 parent::__construct();
82 }
83
84 /**
85 * Returns all the column names of this table
86 *
87 * @return array
88 */
89 public static function &fields() {
90 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
91 Civi::$statics[__CLASS__]['fields'] = [
92 'id' => [
93 'name' => 'id',
94 'type' => CRM_Utils_Type::T_INT,
95 'title' => ts('Prev Next Cache ID'),
96 'required' => TRUE,
97 'table_name' => 'civicrm_prevnext_cache',
98 'entity' => 'PrevNextCache',
99 'bao' => 'CRM_Core_BAO_PrevNextCache',
100 'localizable' => 0,
101 ],
102 'entity_table' => [
103 'name' => 'entity_table',
104 'type' => CRM_Utils_Type::T_STRING,
105 'title' => ts('Prev Next Entity Table'),
106 'description' => ts('physical tablename for entity being joined to discount, e.g. civicrm_event'),
107 'maxlength' => 64,
108 'size' => CRM_Utils_Type::BIG,
109 'table_name' => 'civicrm_prevnext_cache',
110 'entity' => 'PrevNextCache',
111 'bao' => 'CRM_Core_BAO_PrevNextCache',
112 'localizable' => 0,
113 ],
114 'entity_id1' => [
115 'name' => 'entity_id1',
116 'type' => CRM_Utils_Type::T_INT,
117 'title' => ts('Prev Next Entity ID 1'),
118 'description' => ts('FK to entity table specified in entity_table column.'),
119 'required' => TRUE,
120 'table_name' => 'civicrm_prevnext_cache',
121 'entity' => 'PrevNextCache',
122 'bao' => 'CRM_Core_BAO_PrevNextCache',
123 'localizable' => 0,
124 ],
125 'entity_id2' => [
126 'name' => 'entity_id2',
127 'type' => CRM_Utils_Type::T_INT,
128 'title' => ts('Prev Next Entity ID 2'),
129 'description' => ts('FK to entity table specified in entity_table column.'),
130 'required' => FALSE,
131 'table_name' => 'civicrm_prevnext_cache',
132 'entity' => 'PrevNextCache',
133 'bao' => 'CRM_Core_BAO_PrevNextCache',
134 'localizable' => 0,
135 ],
136 'cacheKey' => [
137 'name' => 'cacheKey',
138 'type' => CRM_Utils_Type::T_STRING,
139 'title' => ts('Cache Key'),
140 'description' => ts('Unique path name for cache element of the searched item'),
141 'maxlength' => 255,
142 'size' => CRM_Utils_Type::HUGE,
143 'table_name' => 'civicrm_prevnext_cache',
144 'entity' => 'PrevNextCache',
145 'bao' => 'CRM_Core_BAO_PrevNextCache',
146 'localizable' => 0,
147 ],
148 'data' => [
149 'name' => 'data',
150 'type' => CRM_Utils_Type::T_LONGTEXT,
151 'title' => ts('Prev Next Data'),
152 'description' => ts('cached snapshot of the serialized data'),
153 'table_name' => 'civicrm_prevnext_cache',
154 'entity' => 'PrevNextCache',
155 'bao' => 'CRM_Core_BAO_PrevNextCache',
156 'localizable' => 0,
157 'serialize' => self::SERIALIZE_PHP,
158 ],
159 'is_selected' => [
160 'name' => 'is_selected',
161 'type' => CRM_Utils_Type::T_BOOLEAN,
162 'title' => ts('Is Selected'),
163 'default' => '0',
164 'table_name' => 'civicrm_prevnext_cache',
165 'entity' => 'PrevNextCache',
166 'bao' => 'CRM_Core_BAO_PrevNextCache',
167 'localizable' => 0,
168 ],
169 ];
170 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
171 }
172 return Civi::$statics[__CLASS__]['fields'];
173 }
174
175 /**
176 * Return a mapping from field-name to the corresponding key (as used in fields()).
177 *
178 * @return array
179 * Array(string $name => string $uniqueName).
180 */
181 public static function &fieldKeys() {
182 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
183 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
184 }
185 return Civi::$statics[__CLASS__]['fieldKeys'];
186 }
187
188 /**
189 * Returns the names of this table
190 *
191 * @return string
192 */
193 public static function getTableName() {
194 return self::$_tableName;
195 }
196
197 /**
198 * Returns if this table needs to be logged
199 *
200 * @return bool
201 */
202 public function getLog() {
203 return self::$_log;
204 }
205
206 /**
207 * Returns the list of fields that can be imported
208 *
209 * @param bool $prefix
210 *
211 * @return array
212 */
213 public static function &import($prefix = FALSE) {
214 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'prevnext_cache', $prefix, []);
215 return $r;
216 }
217
218 /**
219 * Returns the list of fields that can be exported
220 *
221 * @param bool $prefix
222 *
223 * @return array
224 */
225 public static function &export($prefix = FALSE) {
226 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'prevnext_cache', $prefix, []);
227 return $r;
228 }
229
230 /**
231 * Returns the list of indices
232 *
233 * @param bool $localize
234 *
235 * @return array
236 */
237 public static function indices($localize = TRUE) {
238 $indices = [
239 'index_all' => [
240 'name' => 'index_all',
241 'field' => [
242 0 => 'cacheKey',
243 1 => 'entity_id1',
244 2 => 'entity_id2',
245 3 => 'entity_table',
246 4 => 'is_selected',
247 ],
248 'localizable' => FALSE,
249 'sig' => 'civicrm_prevnext_cache::0::cacheKey::entity_id1::entity_id2::entity_table::is_selected',
250 ],
251 ];
252 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
253 }
254
255 }