Commit | Line | Data |
---|---|---|
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 | |
f29bf4f3 | 9 | * (GenCodeChecksum:b3e9aecea5100250d4b6ce9a4f6ca036) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the PrevNextCache entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class 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 | */ | |
fa45b5b9 | 22 | public 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 | */ |
fa45b5b9 | 29 | public static $_log = FALSE; |
c3fc2621 | 30 | |
e501603b | 31 | /** |
e6ca0a57 | 32 | * @var int |
e501603b TO |
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 | * | |
e6ca0a57 | 46 | * @var int |
e501603b TO |
47 | */ |
48 | public $entity_id1; | |
c3fc2621 | 49 | |
e501603b TO |
50 | /** |
51 | * FK to entity table specified in entity_table column. | |
52 | * | |
e6ca0a57 | 53 | * @var int |
e501603b TO |
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 | */ | |
783b4b21 | 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 | /** |
e6ca0a57 | 72 | * @var bool |
e501603b TO |
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, | |
a36434b9 | 97 | 'where' => 'civicrm_prevnext_cache.id', |
522a26c9 | 98 | 'table_name' => 'civicrm_prevnext_cache', |
99 | 'entity' => 'PrevNextCache', | |
100 | 'bao' => 'CRM_Core_BAO_PrevNextCache', | |
6a7e5e5d | 101 | 'localizable' => 0, |
c3fc2621 CW |
102 | ], |
103 | 'entity_table' => [ | |
e501603b TO |
104 | 'name' => 'entity_table', |
105 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 106 | 'title' => ts('Prev Next Entity Table'), |
215b423e | 107 | 'description' => ts('physical tablename for entity being joined to discount, e.g. civicrm_event'), |
e501603b TO |
108 | 'maxlength' => 64, |
109 | 'size' => CRM_Utils_Type::BIG, | |
a36434b9 | 110 | 'where' => 'civicrm_prevnext_cache.entity_table', |
522a26c9 | 111 | 'table_name' => 'civicrm_prevnext_cache', |
112 | 'entity' => 'PrevNextCache', | |
113 | 'bao' => 'CRM_Core_BAO_PrevNextCache', | |
6a7e5e5d | 114 | 'localizable' => 0, |
c3fc2621 CW |
115 | ], |
116 | 'entity_id1' => [ | |
e501603b TO |
117 | 'name' => 'entity_id1', |
118 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 119 | 'title' => ts('Prev Next Entity ID 1'), |
215b423e | 120 | 'description' => ts('FK to entity table specified in entity_table column.'), |
c3fc2621 | 121 | 'required' => TRUE, |
a36434b9 | 122 | 'where' => 'civicrm_prevnext_cache.entity_id1', |
522a26c9 | 123 | 'table_name' => 'civicrm_prevnext_cache', |
124 | 'entity' => 'PrevNextCache', | |
125 | 'bao' => 'CRM_Core_BAO_PrevNextCache', | |
6a7e5e5d | 126 | 'localizable' => 0, |
c3fc2621 CW |
127 | ], |
128 | 'entity_id2' => [ | |
e501603b TO |
129 | 'name' => 'entity_id2', |
130 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 131 | 'title' => ts('Prev Next Entity ID 2'), |
215b423e | 132 | 'description' => ts('FK to entity table specified in entity_table column.'), |
230a9938 | 133 | 'required' => FALSE, |
a36434b9 | 134 | 'where' => 'civicrm_prevnext_cache.entity_id2', |
522a26c9 | 135 | 'table_name' => 'civicrm_prevnext_cache', |
136 | 'entity' => 'PrevNextCache', | |
137 | 'bao' => 'CRM_Core_BAO_PrevNextCache', | |
6a7e5e5d | 138 | 'localizable' => 0, |
c3fc2621 | 139 | ], |
783b4b21 SL |
140 | 'cachekey' => [ |
141 | 'name' => 'cachekey', | |
e501603b | 142 | 'type' => CRM_Utils_Type::T_STRING, |
c3fc2621 | 143 | 'title' => ts('Cache Key'), |
215b423e | 144 | 'description' => ts('Unique path name for cache element of the searched item'), |
e501603b TO |
145 | 'maxlength' => 255, |
146 | 'size' => CRM_Utils_Type::HUGE, | |
783b4b21 | 147 | 'where' => 'civicrm_prevnext_cache.cachekey', |
522a26c9 | 148 | 'table_name' => 'civicrm_prevnext_cache', |
149 | 'entity' => 'PrevNextCache', | |
150 | 'bao' => 'CRM_Core_BAO_PrevNextCache', | |
6a7e5e5d | 151 | 'localizable' => 0, |
c3fc2621 CW |
152 | ], |
153 | 'data' => [ | |
e501603b TO |
154 | 'name' => 'data', |
155 | 'type' => CRM_Utils_Type::T_LONGTEXT, | |
c3fc2621 | 156 | 'title' => ts('Prev Next Data'), |
215b423e | 157 | 'description' => ts('cached snapshot of the serialized data'), |
a36434b9 | 158 | 'where' => 'civicrm_prevnext_cache.data', |
522a26c9 | 159 | 'table_name' => 'civicrm_prevnext_cache', |
160 | 'entity' => 'PrevNextCache', | |
161 | 'bao' => 'CRM_Core_BAO_PrevNextCache', | |
6a7e5e5d | 162 | 'localizable' => 0, |
2a5c9b4d | 163 | 'serialize' => self::SERIALIZE_PHP, |
c3fc2621 CW |
164 | ], |
165 | 'is_selected' => [ | |
e501603b TO |
166 | 'name' => 'is_selected', |
167 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 168 | 'title' => ts('Is Selected'), |
a36434b9 | 169 | 'where' => 'civicrm_prevnext_cache.is_selected', |
45a83e42 | 170 | 'default' => '0', |
522a26c9 | 171 | 'table_name' => 'civicrm_prevnext_cache', |
172 | 'entity' => 'PrevNextCache', | |
173 | 'bao' => 'CRM_Core_BAO_PrevNextCache', | |
6a7e5e5d | 174 | 'localizable' => 0, |
c3fc2621 CW |
175 | ], |
176 | ]; | |
346aaaba | 177 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 178 | } |
346aaaba | 179 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 180 | } |
c3fc2621 | 181 | |
e501603b | 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 | 187 | */ |
c3fc2621 | 188 | public 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 | 193 | } |
c3fc2621 | 194 | |
e501603b TO |
195 | /** |
196 | * Returns the names of this table | |
197 | * | |
198 | * @return string | |
199 | */ | |
c3fc2621 | 200 | public static function getTableName() { |
e501603b TO |
201 | return self::$_tableName; |
202 | } | |
c3fc2621 | 203 | |
e501603b TO |
204 | /** |
205 | * Returns if this table needs to be logged | |
206 | * | |
c3fc2621 | 207 | * @return bool |
e501603b | 208 | */ |
c3fc2621 | 209 | public function getLog() { |
e501603b TO |
210 | return self::$_log; |
211 | } | |
c3fc2621 | 212 | |
e501603b TO |
213 | /** |
214 | * Returns the list of fields that can be imported | |
215 | * | |
216 | * @param bool $prefix | |
217 | * | |
218 | * @return array | |
219 | */ | |
c3fc2621 CW |
220 | public static function &import($prefix = FALSE) { |
221 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'prevnext_cache', $prefix, []); | |
60808919 | 222 | return $r; |
e501603b | 223 | } |
c3fc2621 | 224 | |
e501603b TO |
225 | /** |
226 | * Returns the list of fields that can be exported | |
227 | * | |
228 | * @param bool $prefix | |
229 | * | |
230 | * @return array | |
231 | */ | |
c3fc2621 CW |
232 | public static function &export($prefix = FALSE) { |
233 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'prevnext_cache', $prefix, []); | |
60808919 | 234 | return $r; |
e501603b | 235 | } |
c3fc2621 | 236 | |
e7a6b91a AS |
237 | /** |
238 | * Returns the list of indices | |
c3fc2621 CW |
239 | * |
240 | * @param bool $localize | |
241 | * | |
242 | * @return array | |
e7a6b91a AS |
243 | */ |
244 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
245 | $indices = [ |
246 | 'index_all' => [ | |
e7a6b91a | 247 | 'name' => 'index_all', |
c3fc2621 | 248 | 'field' => [ |
783b4b21 | 249 | 0 => 'cachekey', |
e7a6b91a AS |
250 | 1 => 'entity_id1', |
251 | 2 => 'entity_id2', | |
252 | 3 => 'entity_table', | |
253 | 4 => 'is_selected', | |
c3fc2621 CW |
254 | ], |
255 | 'localizable' => FALSE, | |
783b4b21 | 256 | 'sig' => 'civicrm_prevnext_cache::0::cachekey::entity_id1::entity_id2::entity_table::is_selected', |
c3fc2621 CW |
257 | ], |
258 | ]; | |
e7a6b91a AS |
259 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
260 | } | |
c3fc2621 | 261 | |
e501603b | 262 | } |