You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default all not defined fields of the input json will be stored in a class property with the same name.
15
+
By default all public properties of the class will be inspected. For all properties that have a json key with the same name the according value will be set.
16
16
17
17
### A simple example
18
18
Assume you have a class `Person` that looks like this:
@@ -28,10 +28,98 @@ The following code will transform the given json data into an instance of `Perso
The `JsonDecoder` class accepts two boolean constructor parameters to enable the handling of private and protected properties.
78
+
79
+
To do so a so called `AccessProxy` will be installed and on property set the proxy will set the property to accessible, set the according value and then will set the property to not accessible again.
80
+
81
+
## Documentation
82
+
83
+
### Transformer Bindings
84
+
The following `Binding` implementations are available
85
+
86
+
*[FieldBinding](#fieldbinding)
87
+
*[ArrayBinding](#arraybinding)
88
+
*[AliasBinding](#aliasbinding)
89
+
*[CallbackBinding](#callbackbinding)
90
+
91
+
#### FieldBinding
92
+
Defines a json field to property binding for the given type.
93
+
94
+
**Signature:**
95
+
```php
96
+
new FieldBinding($property, $jsonField, $type);
97
+
```
98
+
This defines a field mapping for the property `$property` to a class instance of type `$type` with data in `$jsonField`.
34
99
100
+
#### ArrayBinding
101
+
Defines a array field binding for the given type.
102
+
103
+
**Signature:**
104
+
```php
105
+
new ArrayBinding($property, $jsonField, $type);
106
+
```
107
+
This defines a field mapping for the property `$property` to an array of class instance of type `$type` with data in `$jsonField`.
108
+
109
+
### AliasBinding
110
+
Defines a json field to property binding.
111
+
112
+
**Signature:**
113
+
```php
114
+
new AliasBinding($property, $jsonField);
115
+
```
116
+
117
+
#### CallbackBinding
118
+
Defines a property binding that gets the callback result set as its value.
0 commit comments