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 | |
449c4e6b | 9 | * (GenCodeChecksum:bfe0f84f9404ffcc242ca8c15de4ca14) |
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 | |
449c4e6b CW |
84 | /** |
85 | * Returns localized title of this entity. | |
86 | */ | |
87 | public static function getEntityTitle() { | |
88 | return ts('Prev Next Caches'); | |
89 | } | |
90 | ||
e501603b TO |
91 | /** |
92 | * Returns all the column names of this table | |
93 | * | |
94 | * @return array | |
95 | */ | |
c3fc2621 | 96 | public static function &fields() { |
346aaaba | 97 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
98 | Civi::$statics[__CLASS__]['fields'] = [ |
99 | 'id' => [ | |
e501603b TO |
100 | 'name' => 'id', |
101 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 CW |
102 | 'title' => ts('Prev Next Cache ID'), |
103 | 'required' => TRUE, | |
a36434b9 | 104 | 'where' => 'civicrm_prevnext_cache.id', |
522a26c9 | 105 | 'table_name' => 'civicrm_prevnext_cache', |
106 | 'entity' => 'PrevNextCache', | |
107 | 'bao' => 'CRM_Core_BAO_PrevNextCache', | |
6a7e5e5d | 108 | 'localizable' => 0, |
c3fc2621 CW |
109 | ], |
110 | 'entity_table' => [ | |
e501603b TO |
111 | 'name' => 'entity_table', |
112 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 113 | 'title' => ts('Prev Next Entity Table'), |
215b423e | 114 | 'description' => ts('physical tablename for entity being joined to discount, e.g. civicrm_event'), |
e501603b TO |
115 | 'maxlength' => 64, |
116 | 'size' => CRM_Utils_Type::BIG, | |
a36434b9 | 117 | 'where' => 'civicrm_prevnext_cache.entity_table', |
522a26c9 | 118 | 'table_name' => 'civicrm_prevnext_cache', |
119 | 'entity' => 'PrevNextCache', | |
120 | 'bao' => 'CRM_Core_BAO_PrevNextCache', | |
6a7e5e5d | 121 | 'localizable' => 0, |
c3fc2621 CW |
122 | ], |
123 | 'entity_id1' => [ | |
e501603b TO |
124 | 'name' => 'entity_id1', |
125 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 126 | 'title' => ts('Prev Next Entity ID 1'), |
215b423e | 127 | 'description' => ts('FK to entity table specified in entity_table column.'), |
c3fc2621 | 128 | 'required' => TRUE, |
a36434b9 | 129 | 'where' => 'civicrm_prevnext_cache.entity_id1', |
522a26c9 | 130 | 'table_name' => 'civicrm_prevnext_cache', |
131 | 'entity' => 'PrevNextCache', | |
132 | 'bao' => 'CRM_Core_BAO_PrevNextCache', | |
6a7e5e5d | 133 | 'localizable' => 0, |
c3fc2621 CW |
134 | ], |
135 | 'entity_id2' => [ | |
e501603b TO |
136 | 'name' => 'entity_id2', |
137 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 138 | 'title' => ts('Prev Next Entity ID 2'), |
215b423e | 139 | 'description' => ts('FK to entity table specified in entity_table column.'), |
230a9938 | 140 | 'required' => FALSE, |
a36434b9 | 141 | 'where' => 'civicrm_prevnext_cache.entity_id2', |
522a26c9 | 142 | 'table_name' => 'civicrm_prevnext_cache', |
143 | 'entity' => 'PrevNextCache', | |
144 | 'bao' => 'CRM_Core_BAO_PrevNextCache', | |
6a7e5e5d | 145 | 'localizable' => 0, |
c3fc2621 | 146 | ], |
783b4b21 SL |
147 | 'cachekey' => [ |
148 | 'name' => 'cachekey', | |
e501603b | 149 | 'type' => CRM_Utils_Type::T_STRING, |
c3fc2621 | 150 | 'title' => ts('Cache Key'), |
215b423e | 151 | 'description' => ts('Unique path name for cache element of the searched item'), |
e501603b TO |
152 | 'maxlength' => 255, |
153 | 'size' => CRM_Utils_Type::HUGE, | |
783b4b21 | 154 | 'where' => 'civicrm_prevnext_cache.cachekey', |
522a26c9 | 155 | 'table_name' => 'civicrm_prevnext_cache', |
156 | 'entity' => 'PrevNextCache', | |
157 | 'bao' => 'CRM_Core_BAO_PrevNextCache', | |
6a7e5e5d | 158 | 'localizable' => 0, |
c3fc2621 CW |
159 | ], |
160 | 'data' => [ | |
e501603b TO |
161 | 'name' => 'data', |
162 | 'type' => CRM_Utils_Type::T_LONGTEXT, | |
c3fc2621 | 163 | 'title' => ts('Prev Next Data'), |
215b423e | 164 | 'description' => ts('cached snapshot of the serialized data'), |
a36434b9 | 165 | 'where' => 'civicrm_prevnext_cache.data', |
522a26c9 | 166 | 'table_name' => 'civicrm_prevnext_cache', |
167 | 'entity' => 'PrevNextCache', | |
168 | 'bao' => 'CRM_Core_BAO_PrevNextCache', | |
6a7e5e5d | 169 | 'localizable' => 0, |
2a5c9b4d | 170 | 'serialize' => self::SERIALIZE_PHP, |
c3fc2621 CW |
171 | ], |
172 | 'is_selected' => [ | |
e501603b TO |
173 | 'name' => 'is_selected', |
174 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 175 | 'title' => ts('Is Selected'), |
a36434b9 | 176 | 'where' => 'civicrm_prevnext_cache.is_selected', |
45a83e42 | 177 | 'default' => '0', |
522a26c9 | 178 | 'table_name' => 'civicrm_prevnext_cache', |
179 | 'entity' => 'PrevNextCache', | |
180 | 'bao' => 'CRM_Core_BAO_PrevNextCache', | |
6a7e5e5d | 181 | 'localizable' => 0, |
c3fc2621 CW |
182 | ], |
183 | ]; | |
346aaaba | 184 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 185 | } |
346aaaba | 186 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 187 | } |
c3fc2621 | 188 | |
e501603b | 189 | /** |
bd8e0b14 | 190 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
191 | * |
192 | * @return array | |
bd8e0b14 | 193 | * Array(string $name => string $uniqueName). |
e501603b | 194 | */ |
c3fc2621 | 195 | public static function &fieldKeys() { |
bd8e0b14 TO |
196 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
197 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 198 | } |
bd8e0b14 | 199 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 200 | } |
c3fc2621 | 201 | |
e501603b TO |
202 | /** |
203 | * Returns the names of this table | |
204 | * | |
205 | * @return string | |
206 | */ | |
c3fc2621 | 207 | public static function getTableName() { |
e501603b TO |
208 | return self::$_tableName; |
209 | } | |
c3fc2621 | 210 | |
e501603b TO |
211 | /** |
212 | * Returns if this table needs to be logged | |
213 | * | |
c3fc2621 | 214 | * @return bool |
e501603b | 215 | */ |
c3fc2621 | 216 | public function getLog() { |
e501603b TO |
217 | return self::$_log; |
218 | } | |
c3fc2621 | 219 | |
e501603b TO |
220 | /** |
221 | * Returns the list of fields that can be imported | |
222 | * | |
223 | * @param bool $prefix | |
224 | * | |
225 | * @return array | |
226 | */ | |
c3fc2621 CW |
227 | public static function &import($prefix = FALSE) { |
228 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'prevnext_cache', $prefix, []); | |
60808919 | 229 | return $r; |
e501603b | 230 | } |
c3fc2621 | 231 | |
e501603b TO |
232 | /** |
233 | * Returns the list of fields that can be exported | |
234 | * | |
235 | * @param bool $prefix | |
236 | * | |
237 | * @return array | |
238 | */ | |
c3fc2621 CW |
239 | public static function &export($prefix = FALSE) { |
240 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'prevnext_cache', $prefix, []); | |
60808919 | 241 | return $r; |
e501603b | 242 | } |
c3fc2621 | 243 | |
e7a6b91a AS |
244 | /** |
245 | * Returns the list of indices | |
c3fc2621 CW |
246 | * |
247 | * @param bool $localize | |
248 | * | |
249 | * @return array | |
e7a6b91a AS |
250 | */ |
251 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
252 | $indices = [ |
253 | 'index_all' => [ | |
e7a6b91a | 254 | 'name' => 'index_all', |
c3fc2621 | 255 | 'field' => [ |
783b4b21 | 256 | 0 => 'cachekey', |
e7a6b91a AS |
257 | 1 => 'entity_id1', |
258 | 2 => 'entity_id2', | |
259 | 3 => 'entity_table', | |
260 | 4 => 'is_selected', | |
c3fc2621 CW |
261 | ], |
262 | 'localizable' => FALSE, | |
783b4b21 | 263 | 'sig' => 'civicrm_prevnext_cache::0::cachekey::entity_id1::entity_id2::entity_table::is_selected', |
c3fc2621 CW |
264 | ], |
265 | ]; | |
e7a6b91a AS |
266 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
267 | } | |
c3fc2621 | 268 | |
e501603b | 269 | } |