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
Copy file name to clipboardExpand all lines: docs/Attributes/PhpProperty.md
+12-3Lines changed: 12 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,22 @@
1
-
[back to overview](../Index.md)
1
+
[back to overview](../README.md)
2
2
3
3
---
4
+
5
+
**Table of contents**
6
+
1.[PhpProperty](#PhpProperty)
7
+
1. [Example 1: Serialize](#Example-1:-Serialize)
8
+
2. [Example 2: Deserialize with classname](#Example-1:-Deserialize-with-classname)
9
+
3. [Example 3: Deserialization with actual name.](#Example-1:-Deserialize-with-actual-name)
10
+
11
+
---
12
+
4
13
# PhpProperty
5
14
6
15
Specifiy the name of the property in the serialization data, for both serialization and deserialization.
7
16
8
-
Please be aware that the actual name of the property may be used as a fallback for assignment. See example 3.
17
+
Please be aware that the actual name of the property may be used as a fallback for assignment. See [example 3](#Example-1:-Deserialize-with-actual-name).
@@ -179,12 +186,12 @@ var deserializedBool = PhpSerialization.Deserialize<boolean>(
179
186
180
187
**Default value:**`System.Text.Encoding.UTF8`
181
188
182
-
**Example:**
189
+
**Example:**
183
190
[See the unit tests](https://github.com/StringEpsilon/PhpSerializerNET/blob/main/PhpSerializerNET.Test/Deserialize/Options/InputEncoding.cs)
184
191
185
192
## StdClass
186
193
187
-
**Description:** Target datatype for objects of type "stdClass".
194
+
**Description:** Target datatype for objects of with classname "stdClass".
188
195
189
196
Note: This does not affect explicitly typed deserialization via ```PhpSerialization.Deserialize<T>()```
190
197
@@ -194,8 +201,8 @@ Note: This does not affect explicitly typed deserialization via ```PhpSerializat
194
201
195
202
**Description:** Enable or disable lookup in currently loaded assemblies for target classes and structs to deserialize objects into. i.E. `o:8:"UserInfo":...` being mapped to a UserInfo class.
196
203
197
-
**Notes:**
198
-
* Disabling this option can improve performance in some cases and reduce memory footprint. Finding a class or struct with a given name is a relatively costly operation and the library caches the results.
204
+
**Notes:**
205
+
* Disabling this option can improve performance in some cases and reduce memory footprint. Finding a class or struct with a given name is a relatively costly operation and the library caches the results.
199
206
* The caching might lead to some unexpected behaviors too. If the library can not find a type for a given name, the negative result will be stored for future deserializations. If a new assembly with a matchign type is loaded in the meantime, the type lookup will still fail and the fallback option (see [PhpDeserializationOptions.StdClass](#StdClass)) will be used.
200
207
201
208
**Default value:**`true`
@@ -235,6 +242,10 @@ var deserialized = PhpSerialization.Deserialize(
235
242
// See also the StdClass option.
236
243
```
237
244
245
+
## TypeCache
246
+
247
+
Controls what type information cached. See [TypeCacheFlag](#TypeCacheFlag) for details.
248
+
238
249
# ListOptions
239
250
240
251
Available values for [PhpDeserializationOptions.UseLists](#UseLists).
@@ -243,9 +254,9 @@ Available values for [PhpDeserializationOptions.UseLists](#UseLists).
243
254
244
255
Convert associative array to list when all keys are consecutive integers. Otherwise make a dictionary.
245
256
246
-
**Notes:**
257
+
**Notes:**
247
258
* This means `0, 1, 2, 3, 4`, but also `9, 10, 11, 12`. The library does not check that the indizes start at 0.
248
-
* The consecutiveness is only checked in the positive direction.
259
+
* The consecutiveness is only checked in the positive direction.
249
260
250
261
**Example**
251
262
@@ -299,10 +310,93 @@ Available values for [PhpDeserializationOptions.StdClass](#StdClass).
299
310
300
311
Deserialize all 'stdClass' objects into `PhpObjectDictionary` (extending `Dictionary<string, object>`).
Deserialize all 'stdClass' objects into dynamic objects (see `PhpDynamicObject`).
330
+
Deserialize all 'stdClass' objects into dynamic objects. See [System.Dynamic.DynamicObject](https://docs.microsoft.com/en-us/dotnet/api/system.dynamic.dynamicobject?view=net-6.0) for more details on dynamic objects in general.
331
+
332
+
The option will result in instances of [PhpDynamicObject](../Types/PhpDynamicObject.md) specifically.
0 commit comments