Merge pull request #22992 from eileenmcnaughton/billingnot
[civicrm-core.git] / CRM / Core / DAO / PrevNextCache.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
ca5cec67 5 * @copyright CiviCRM LLC https://civicrm.org/licensing
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Core/PrevNextCache.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
28979d65 9 * (GenCodeChecksum:34c9a3b8f37f15fa5f0d9174e5e1c981)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the PrevNextCache entity.
f41f0342 14 */
e501603b 15class CRM_Core_DAO_PrevNextCache extends CRM_Core_DAO {
929a1c14
CW
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '3.4';
c3fc2621 18
e501603b 19 /**
f41f0342 20 * Static instance to hold the table name.
e501603b
TO
21 *
22 * @var string
23 */
fa45b5b9 24 public static $_tableName = 'civicrm_prevnext_cache';
c3fc2621 25
e501603b 26 /**
f41f0342 27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 28 *
c3fc2621 29 * @var bool
e501603b 30 */
fa45b5b9 31 public static $_log = FALSE;
c3fc2621 32
e501603b 33 /**
28979d65
CW
34 * @var int|string|null
35 * (SQL type: int unsigned)
36 * Note that values will be retrieved from the database as a string.
e501603b
TO
37 */
38 public $id;
c3fc2621 39
e501603b
TO
40 /**
41 * physical tablename for entity being joined to discount, e.g. civicrm_event
42 *
28979d65
CW
43 * @var string|null
44 * (SQL type: varchar(64))
45 * Note that values will be retrieved from the database as a string.
e501603b
TO
46 */
47 public $entity_table;
c3fc2621 48
e501603b
TO
49 /**
50 * FK to entity table specified in entity_table column.
51 *
28979d65
CW
52 * @var int|string
53 * (SQL type: int unsigned)
54 * Note that values will be retrieved from the database as a string.
e501603b
TO
55 */
56 public $entity_id1;
c3fc2621 57
e501603b
TO
58 /**
59 * FK to entity table specified in entity_table column.
60 *
28979d65
CW
61 * @var int|string
62 * (SQL type: int unsigned)
63 * Note that values will be retrieved from the database as a string.
e501603b
TO
64 */
65 public $entity_id2;
c3fc2621 66
e501603b
TO
67 /**
68 * Unique path name for cache element of the searched item
69 *
28979d65
CW
70 * @var string|null
71 * (SQL type: varchar(255))
72 * Note that values will be retrieved from the database as a string.
e501603b 73 */
783b4b21 74 public $cachekey;
c3fc2621 75
e501603b
TO
76 /**
77 * cached snapshot of the serialized data
78 *
28979d65
CW
79 * @var string|null
80 * (SQL type: longtext)
81 * Note that values will be retrieved from the database as a string.
e501603b
TO
82 */
83 public $data;
c3fc2621 84
e501603b 85 /**
28979d65
CW
86 * @var bool|string|null
87 * (SQL type: tinyint)
88 * Note that values will be retrieved from the database as a string.
e501603b
TO
89 */
90 public $is_selected;
c3fc2621 91
e501603b 92 /**
f41f0342 93 * Class constructor.
e501603b 94 */
c3fc2621 95 public function __construct() {
e501603b
TO
96 $this->__table = 'civicrm_prevnext_cache';
97 parent::__construct();
98 }
c3fc2621 99
449c4e6b
CW
100 /**
101 * Returns localized title of this entity.
7b66c3b5
AH
102 *
103 * @param bool $plural
104 * Whether to return the plural version of the title.
449c4e6b 105 */
7b66c3b5
AH
106 public static function getEntityTitle($plural = FALSE) {
107 return $plural ? ts('Prev Next Caches') : ts('Prev Next Cache');
449c4e6b
CW
108 }
109
e501603b
TO
110 /**
111 * Returns all the column names of this table
112 *
113 * @return array
114 */
c3fc2621 115 public static function &fields() {
346aaaba 116 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
117 Civi::$statics[__CLASS__]['fields'] = [
118 'id' => [
e501603b
TO
119 'name' => 'id',
120 'type' => CRM_Utils_Type::T_INT,
c3fc2621
CW
121 'title' => ts('Prev Next Cache ID'),
122 'required' => TRUE,
a36434b9 123 'where' => 'civicrm_prevnext_cache.id',
522a26c9 124 'table_name' => 'civicrm_prevnext_cache',
125 'entity' => 'PrevNextCache',
126 'bao' => 'CRM_Core_BAO_PrevNextCache',
6a7e5e5d 127 'localizable' => 0,
2cbbebe8
A
128 'html' => [
129 'type' => 'Number',
130 ],
1fe423d6 131 'readonly' => TRUE,
a9d0587b 132 'add' => '3.4',
c3fc2621
CW
133 ],
134 'entity_table' => [
e501603b
TO
135 'name' => 'entity_table',
136 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 137 'title' => ts('Prev Next Entity Table'),
215b423e 138 'description' => ts('physical tablename for entity being joined to discount, e.g. civicrm_event'),
e501603b
TO
139 'maxlength' => 64,
140 'size' => CRM_Utils_Type::BIG,
a36434b9 141 'where' => 'civicrm_prevnext_cache.entity_table',
522a26c9 142 'table_name' => 'civicrm_prevnext_cache',
143 'entity' => 'PrevNextCache',
144 'bao' => 'CRM_Core_BAO_PrevNextCache',
6a7e5e5d 145 'localizable' => 0,
a9d0587b 146 'add' => '3.4',
c3fc2621
CW
147 ],
148 'entity_id1' => [
e501603b
TO
149 'name' => 'entity_id1',
150 'type' => CRM_Utils_Type::T_INT,
c3fc2621 151 'title' => ts('Prev Next Entity ID 1'),
215b423e 152 'description' => ts('FK to entity table specified in entity_table column.'),
c3fc2621 153 'required' => TRUE,
a36434b9 154 'where' => 'civicrm_prevnext_cache.entity_id1',
522a26c9 155 'table_name' => 'civicrm_prevnext_cache',
156 'entity' => 'PrevNextCache',
157 'bao' => 'CRM_Core_BAO_PrevNextCache',
6a7e5e5d 158 'localizable' => 0,
a9d0587b 159 'add' => '3.4',
c3fc2621
CW
160 ],
161 'entity_id2' => [
e501603b
TO
162 'name' => 'entity_id2',
163 'type' => CRM_Utils_Type::T_INT,
c3fc2621 164 'title' => ts('Prev Next Entity ID 2'),
215b423e 165 'description' => ts('FK to entity table specified in entity_table column.'),
230a9938 166 'required' => FALSE,
a36434b9 167 'where' => 'civicrm_prevnext_cache.entity_id2',
522a26c9 168 'table_name' => 'civicrm_prevnext_cache',
169 'entity' => 'PrevNextCache',
170 'bao' => 'CRM_Core_BAO_PrevNextCache',
6a7e5e5d 171 'localizable' => 0,
a9d0587b 172 'add' => '3.4',
c3fc2621 173 ],
783b4b21
SL
174 'cachekey' => [
175 'name' => 'cachekey',
e501603b 176 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 177 'title' => ts('Cache Key'),
215b423e 178 'description' => ts('Unique path name for cache element of the searched item'),
e501603b
TO
179 'maxlength' => 255,
180 'size' => CRM_Utils_Type::HUGE,
783b4b21 181 'where' => 'civicrm_prevnext_cache.cachekey',
522a26c9 182 'table_name' => 'civicrm_prevnext_cache',
183 'entity' => 'PrevNextCache',
184 'bao' => 'CRM_Core_BAO_PrevNextCache',
6a7e5e5d 185 'localizable' => 0,
a9d0587b 186 'add' => '3.4',
c3fc2621
CW
187 ],
188 'data' => [
e501603b
TO
189 'name' => 'data',
190 'type' => CRM_Utils_Type::T_LONGTEXT,
c3fc2621 191 'title' => ts('Prev Next Data'),
215b423e 192 'description' => ts('cached snapshot of the serialized data'),
a36434b9 193 'where' => 'civicrm_prevnext_cache.data',
522a26c9 194 'table_name' => 'civicrm_prevnext_cache',
195 'entity' => 'PrevNextCache',
196 'bao' => 'CRM_Core_BAO_PrevNextCache',
6a7e5e5d 197 'localizable' => 0,
2a5c9b4d 198 'serialize' => self::SERIALIZE_PHP,
a9d0587b 199 'add' => '3.4',
c3fc2621
CW
200 ],
201 'is_selected' => [
e501603b
TO
202 'name' => 'is_selected',
203 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 204 'title' => ts('Is Selected'),
a36434b9 205 'where' => 'civicrm_prevnext_cache.is_selected',
45a83e42 206 'default' => '0',
522a26c9 207 'table_name' => 'civicrm_prevnext_cache',
208 'entity' => 'PrevNextCache',
209 'bao' => 'CRM_Core_BAO_PrevNextCache',
6a7e5e5d 210 'localizable' => 0,
a9d0587b 211 'add' => '4.2',
c3fc2621
CW
212 ],
213 ];
346aaaba 214 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 215 }
346aaaba 216 return Civi::$statics[__CLASS__]['fields'];
e501603b 217 }
c3fc2621 218
e501603b 219 /**
bd8e0b14 220 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
221 *
222 * @return array
bd8e0b14 223 * Array(string $name => string $uniqueName).
e501603b 224 */
c3fc2621 225 public static function &fieldKeys() {
bd8e0b14
TO
226 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
227 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 228 }
bd8e0b14 229 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 230 }
c3fc2621 231
e501603b
TO
232 /**
233 * Returns the names of this table
234 *
235 * @return string
236 */
c3fc2621 237 public static function getTableName() {
e501603b
TO
238 return self::$_tableName;
239 }
c3fc2621 240
e501603b
TO
241 /**
242 * Returns if this table needs to be logged
243 *
c3fc2621 244 * @return bool
e501603b 245 */
c3fc2621 246 public function getLog() {
e501603b
TO
247 return self::$_log;
248 }
c3fc2621 249
e501603b
TO
250 /**
251 * Returns the list of fields that can be imported
252 *
253 * @param bool $prefix
254 *
255 * @return array
256 */
c3fc2621
CW
257 public static function &import($prefix = FALSE) {
258 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'prevnext_cache', $prefix, []);
60808919 259 return $r;
e501603b 260 }
c3fc2621 261
e501603b
TO
262 /**
263 * Returns the list of fields that can be exported
264 *
265 * @param bool $prefix
266 *
267 * @return array
268 */
c3fc2621
CW
269 public static function &export($prefix = FALSE) {
270 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'prevnext_cache', $prefix, []);
60808919 271 return $r;
e501603b 272 }
c3fc2621 273
e7a6b91a
AS
274 /**
275 * Returns the list of indices
c3fc2621
CW
276 *
277 * @param bool $localize
278 *
279 * @return array
e7a6b91a
AS
280 */
281 public static function indices($localize = TRUE) {
c3fc2621
CW
282 $indices = [
283 'index_all' => [
e7a6b91a 284 'name' => 'index_all',
c3fc2621 285 'field' => [
783b4b21 286 0 => 'cachekey',
e7a6b91a
AS
287 1 => 'entity_id1',
288 2 => 'entity_id2',
289 3 => 'entity_table',
290 4 => 'is_selected',
c3fc2621
CW
291 ],
292 'localizable' => FALSE,
783b4b21 293 'sig' => 'civicrm_prevnext_cache::0::cachekey::entity_id1::entity_id2::entity_table::is_selected',
c3fc2621
CW
294 ],
295 ];
e7a6b91a
AS
296 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
297 }
c3fc2621 298
e501603b 299}