Commit | Line | Data |
---|---|---|
e501603b | 1 | <?php |
c3fc2621 | 2 | |
e501603b TO |
3 | /** |
4 | * @package CRM | |
6b83d5bd | 5 | * @copyright CiviCRM LLC (c) 2004-2019 |
e501603b TO |
6 | * |
7 | * Generated from xml/schema/CRM/Core/PrevNextCache.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
e380ee3b | 9 | * (GenCodeChecksum:ec5d04442cf8976a3163cabeb3ba433c) |
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 | */ | |
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'), |
215b423e | 106 | 'description' => ts('physical tablename for entity being joined to discount, e.g. civicrm_event'), |
e501603b TO |
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'), |
215b423e | 118 | 'description' => ts('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'), |
215b423e | 129 | 'description' => ts('FK to entity table specified in entity_table column.'), |
230a9938 | 130 | 'required' => FALSE, |
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'), |
215b423e | 140 | 'description' => ts('Unique path name for cache element of the searched item'), |
e501603b TO |
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'), |
215b423e | 152 | 'description' => ts('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'), |
45a83e42 | 163 | 'default' => '0', |
522a26c9 | 164 | 'table_name' => 'civicrm_prevnext_cache', |
165 | 'entity' => 'PrevNextCache', | |
166 | 'bao' => 'CRM_Core_BAO_PrevNextCache', | |
6a7e5e5d | 167 | 'localizable' => 0, |
c3fc2621 CW |
168 | ], |
169 | ]; | |
346aaaba | 170 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 171 | } |
346aaaba | 172 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 173 | } |
c3fc2621 | 174 | |
e501603b | 175 | /** |
bd8e0b14 | 176 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
177 | * |
178 | * @return array | |
bd8e0b14 | 179 | * Array(string $name => string $uniqueName). |
e501603b | 180 | */ |
c3fc2621 | 181 | public static function &fieldKeys() { |
bd8e0b14 TO |
182 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
183 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 184 | } |
bd8e0b14 | 185 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 186 | } |
c3fc2621 | 187 | |
e501603b TO |
188 | /** |
189 | * Returns the names of this table | |
190 | * | |
191 | * @return string | |
192 | */ | |
c3fc2621 | 193 | public static function getTableName() { |
e501603b TO |
194 | return self::$_tableName; |
195 | } | |
c3fc2621 | 196 | |
e501603b TO |
197 | /** |
198 | * Returns if this table needs to be logged | |
199 | * | |
c3fc2621 | 200 | * @return bool |
e501603b | 201 | */ |
c3fc2621 | 202 | public function getLog() { |
e501603b TO |
203 | return self::$_log; |
204 | } | |
c3fc2621 | 205 | |
e501603b TO |
206 | /** |
207 | * Returns the list of fields that can be imported | |
208 | * | |
209 | * @param bool $prefix | |
210 | * | |
211 | * @return array | |
212 | */ | |
c3fc2621 CW |
213 | public static function &import($prefix = FALSE) { |
214 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'prevnext_cache', $prefix, []); | |
60808919 | 215 | return $r; |
e501603b | 216 | } |
c3fc2621 | 217 | |
e501603b TO |
218 | /** |
219 | * Returns the list of fields that can be exported | |
220 | * | |
221 | * @param bool $prefix | |
222 | * | |
223 | * @return array | |
224 | */ | |
c3fc2621 CW |
225 | public static function &export($prefix = FALSE) { |
226 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'prevnext_cache', $prefix, []); | |
60808919 | 227 | return $r; |
e501603b | 228 | } |
c3fc2621 | 229 | |
e7a6b91a AS |
230 | /** |
231 | * Returns the list of indices | |
c3fc2621 CW |
232 | * |
233 | * @param bool $localize | |
234 | * | |
235 | * @return array | |
e7a6b91a AS |
236 | */ |
237 | public static function indices($localize = TRUE) { | |
c3fc2621 CW |
238 | $indices = [ |
239 | 'index_all' => [ | |
e7a6b91a | 240 | 'name' => 'index_all', |
c3fc2621 | 241 | 'field' => [ |
e7a6b91a AS |
242 | 0 => 'cacheKey', |
243 | 1 => 'entity_id1', | |
244 | 2 => 'entity_id2', | |
245 | 3 => 'entity_table', | |
246 | 4 => 'is_selected', | |
c3fc2621 CW |
247 | ], |
248 | 'localizable' => FALSE, | |
e7a6b91a | 249 | 'sig' => 'civicrm_prevnext_cache::0::cacheKey::entity_id1::entity_id2::entity_table::is_selected', |
c3fc2621 CW |
250 | ], |
251 | ]; | |
e7a6b91a AS |
252 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
253 | } | |
c3fc2621 | 254 | |
e501603b | 255 | } |