1 | <?php |
||
9 | class WPSC_Checkout_Form_Data extends WPSC_Query_Base { |
||
10 | protected $raw_data = array(); |
||
11 | protected $segmented_data = array(); |
||
12 | protected $gateway_data = array(); |
||
13 | protected $submitted_data = array(); |
||
14 | protected $log_id = 0; |
||
15 | |||
16 | /** |
||
17 | * An array of arrays of cache keys. Allows versioning the cached values, |
||
18 | * and busting cache for a group if needed (by incrementing the version). |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | protected $group_ids = array( |
||
23 | 'raw_data' => array( |
||
24 | 'group' => 'wpsc_checkout_form_raw_data', |
||
25 | 'version' => 1, |
||
26 | ), |
||
27 | 'gateway_data' => array( |
||
28 | 'group' => 'wpsc_checkout_form_gateway_data', |
||
29 | 'version' => 0, |
||
30 | ), |
||
31 | ); |
||
32 | |||
33 | public function __construct( $log_id ) { |
||
37 | |||
38 | /** |
||
39 | * Fetches the actual $data array. |
||
40 | * |
||
41 | * @access protected |
||
42 | * @since 4.0 |
||
43 | * |
||
44 | * @return WPSC_Query_Base |
||
45 | */ |
||
46 | protected function fetch() { |
||
98 | |||
99 | /** |
||
100 | * Get the raw data indexed by the 'id' column. |
||
101 | * |
||
102 | * @since 4.0 |
||
103 | * |
||
104 | * @return array |
||
105 | */ |
||
106 | public function get_indexed_raw_data() { |
||
116 | |||
117 | /** |
||
118 | * Determines if values in shipping fields matches values in billing fields. |
||
119 | * |
||
120 | * @since 4.0 |
||
121 | * |
||
122 | * @return bool Whether shipping values match billing values. |
||
123 | */ |
||
124 | public function shipping_matches_billing() { |
||
149 | |||
150 | /** |
||
151 | * Get the segmented billing info. |
||
152 | * |
||
153 | * @since 4.0 |
||
154 | * |
||
155 | * @return array |
||
156 | */ |
||
157 | public function get_billing_data() { |
||
162 | |||
163 | /** |
||
164 | * Get the segmented shipping info. |
||
165 | * |
||
166 | * @since 4.0 |
||
167 | * |
||
168 | * @return array |
||
169 | */ |
||
170 | public function get_shipping_data() { |
||
175 | |||
176 | /** |
||
177 | * Gets the raw data array. |
||
178 | * |
||
179 | * @since 4.0 |
||
180 | * |
||
181 | * @return array |
||
182 | */ |
||
183 | public function get_raw_data() { |
||
188 | |||
189 | /** |
||
190 | * Prepares the return value for get() (apply_filters, etc). |
||
191 | * |
||
192 | * @access protected |
||
193 | * @since 4.0 |
||
194 | * |
||
195 | * @param mixed $value Value fetched |
||
196 | * @param string $key Key for $data. |
||
197 | * |
||
198 | * @return mixed |
||
199 | */ |
||
200 | protected function prepare_get( $value, $key ) { |
||
203 | |||
204 | /** |
||
205 | * Prepares the return value for get_data() (apply_filters, etc). |
||
206 | * |
||
207 | * @access protected |
||
208 | * @since 4.0 |
||
209 | * |
||
210 | * @return mixed |
||
211 | */ |
||
212 | protected function prepare_get_data() { |
||
215 | |||
216 | public function get_gateway_data() { |
||
260 | |||
261 | /** |
||
262 | * Set specific database fields. |
||
263 | * |
||
264 | * @param string|int $key Expects either form ID or unique name. |
||
265 | * @param string $value Value to be set for field. |
||
266 | * |
||
267 | * @since 4.0 |
||
268 | * @return WPSC_Checkout_Form_Data Current instance of form data. |
||
269 | */ |
||
270 | public function set( $key, $value = '' ) { |
||
281 | |||
282 | /** |
||
283 | * Used in conjunction with set() method, saves individual checkout form fields to database. |
||
284 | * |
||
285 | * @since 4.0 |
||
286 | * @return void |
||
287 | */ |
||
288 | public function save() { |
||
300 | |||
301 | /** |
||
302 | * Save Submitted Form Fields to the wpsc_submited_form_data table. |
||
303 | * |
||
304 | * @param WPSC_Purchase_Log $purchase_log |
||
305 | * @param array $fields |
||
306 | * @return void |
||
307 | */ |
||
308 | public static function save_form( $purchase_log, $fields, $data = array() ) { |
||
354 | |||
355 | /** |
||
356 | * Returns the log id property. |
||
357 | * |
||
358 | * @since 4.0 |
||
359 | * |
||
360 | * @return int The log id. |
||
361 | */ |
||
362 | public function get_log_id() { |
||
365 | |||
366 | } |
||
367 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..