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