1 | <?php |
||
14 | class JsonObject extends AbstractJsonDeserializeObject implements \JsonSerializable |
||
15 | { |
||
16 | use ContextTrait; |
||
17 | |||
18 | const TYPE = 'type'; |
||
19 | const OPTIONAL = 'optional'; |
||
20 | const INITIALIZED = 'initialized'; |
||
21 | const DECORATOR = 'decorator'; |
||
22 | const ELEMENT_TYPE = 'elementType'; |
||
23 | |||
24 | /** |
||
25 | * @param array $data |
||
26 | * @param Context|callable $context |
||
27 | */ |
||
28 | 988 | public function __construct(array $data = [], $context = null) |
|
32 | |||
33 | /** |
||
34 | * @return array |
||
35 | * @internal |
||
36 | */ |
||
37 | 1 | public function fieldDefinitions() |
|
41 | |||
42 | /** |
||
43 | * @param $method |
||
44 | * @param $arguments |
||
45 | * @return $this|bool|mixed |
||
46 | * @internal |
||
47 | */ |
||
48 | 689 | public function __call($method, $arguments) |
|
72 | |||
73 | public function __get($field) |
||
82 | |||
83 | /** |
||
84 | * @param $field |
||
85 | * @return bool |
||
86 | */ |
||
87 | 3 | public function hasField($field) |
|
91 | |||
92 | /** |
||
93 | * @param string $field |
||
94 | * @return bool |
||
95 | * @internal |
||
96 | */ |
||
97 | 689 | protected function isValidField($field) |
|
104 | |||
105 | /** |
||
106 | * @param string $field |
||
107 | * @return array |
||
108 | * @internal |
||
109 | */ |
||
110 | 687 | protected function fieldDefinition($field) |
|
114 | |||
115 | /** |
||
116 | * @param string $field |
||
117 | * @param string $key |
||
118 | * @param $default |
||
119 | * @return bool|string |
||
120 | * @internal |
||
121 | */ |
||
122 | 688 | protected function fieldDefinitionValue($field, $key, $default = false) |
|
132 | |||
133 | /** |
||
134 | * @param string $field |
||
135 | * @return mixed |
||
136 | * @internal |
||
137 | */ |
||
138 | 407 | public function get($field) |
|
142 | |||
143 | 687 | protected function fieldDefinitionType($field) |
|
147 | /** |
||
148 | * @param string $field |
||
149 | * @internal |
||
150 | */ |
||
151 | 358 | protected function initialize($field) |
|
182 | |||
183 | 2 | public function isOptional($field) |
|
187 | |||
188 | 681 | protected function decorateField($field, $value) |
|
196 | |||
197 | /** |
||
198 | * @param string $field |
||
199 | * @param mixed $value |
||
200 | * @return $this |
||
201 | * @internal |
||
202 | */ |
||
203 | 645 | public function set($field, $value) |
|
225 | } |
||
226 |