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