PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.12.7
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.12.7
3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 All 261 releases
wpfunnels / includes / core / data-store / abstact-wpfnl-store-cpt.php

abstact-wpfnl-store-cpt.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.12.7, at includes/core/data-store/abstact-wpfnl-store-cpt.php

80 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Store CPT
4 *
5 * @package
6 */
7 namespace WPFunnels\Data_Store;
8
9 use WPFunnels\Exception\Wpfnl_Data_Exception;
10
11 abstract class Wpfnl_Abstract_Store_data implements Wpfnl_Data_Store
12 {
13 protected $id;
14
15 abstract public function set_data(\WP_Post $post);
16
17 public function set_id($id)
18 {
19 $this->id = $id;
20 }
21
22 public function get_id()
23 {
24 return $this->id;
25 }
26
27 public function delete($id)
28 {
29 }
30
31 public function get_meta($id, $key)
32 {
33 return get_post_meta($id, $key, true);
34 }
35
36 public function update_meta($id, $key, $value)
37 {
38 if(is_array($value)) {
39 if(count($value)) {
40 update_post_meta($id, $key, $value);
41 }else {
42 delete_post_meta( $id, $key );
43 }
44 } elseif (!empty($value)) {
45 update_post_meta($id, $key, $value);
46 } else {
47 delete_post_meta( $id, $key );
48 }
49 }
50
51 public function delete_meta()
52 {
53
54 }
55
56
57 public function read($id)
58 {
59
60 }
61
62
63 /**
64 * When invalid data is found exception will
65 * be thrown without reading from DB
66 *
67 * @param $code
68 * @param $message
69 * @param int $http_status_code
70 * @param array $data
71 *
72 * @throws Wpfnl_Data_Exception
73 * @since 1.0.0
74 */
75 protected function error($code, $message, $http_status_code = 400, $data = [])
76 {
77 throw new Wpfnl_Data_Exception($code, $message, $http_status_code, $data);
78 }
79 }
80