1 | <?php |
||
16 | abstract class JsonDataWordpressOption extends WordPressOption |
||
17 | { |
||
18 | |||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | private $options; |
||
23 | |||
24 | /** |
||
25 | * @var JsonDataHandler |
||
26 | */ |
||
27 | private $json_data_handler; |
||
28 | |||
29 | |||
30 | /** |
||
31 | * JsonDataWordpressOption constructor. |
||
32 | * |
||
33 | * @param JsonDataHandler $json_data_handler |
||
34 | * @param string $option_name |
||
35 | * @param $default_value |
||
36 | */ |
||
37 | public function __construct(JsonDataHandler $json_data_handler, string $option_name, $default_value) |
||
43 | |||
44 | |||
45 | /** |
||
46 | * @param $options |
||
47 | */ |
||
48 | private function update($options) |
||
54 | |||
55 | |||
56 | /** |
||
57 | * @param string $property |
||
58 | * @param mixed $value |
||
59 | * @return void |
||
60 | */ |
||
61 | public function addProperty(string $property, $value) |
||
67 | |||
68 | |||
69 | /** |
||
70 | * @param string $property |
||
71 | * @return mixed |
||
72 | */ |
||
73 | public function getProperty(string $property) |
||
78 | |||
79 | |||
80 | /** |
||
81 | * @return array|mixed|stdClass |
||
82 | */ |
||
83 | public function getAll() |
||
90 | |||
91 | |||
92 | /** |
||
93 | * @param string $property |
||
94 | * @return void |
||
95 | */ |
||
96 | public function removeProperty(string $property) |
||
102 | } |
||
103 |