Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitce28629

Browse files
94nonijaviereguiluz
authored andcommitted
[Serializer] (re)document PRESERVE_EMPTY_OBJECTS
1 parentccd1137 commitce28629

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎serializer.rst‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,6 +1571,13 @@ to ``true``::
15711571
]);
15721572
// $jsonContent contains {"name":"Jane Doe"}
15731573

1574+
Preserving Empty Objetcs
1575+
~~~~~~~~~~~~~~~~~~~~~~~~
1576+
1577+
By default, the Serializer will transform an empty array to `[]`.
1578+
You can change this behavior by setting the ``AbstractObjectNormalizer::PRESERVE_EMPTY_OBJECTS`` context option
1579+
to ``true``, when the value is `\ArrayObject()` the serialization would be `{}`.
1580+
15741581
Handling Uninitialized Properties
15751582
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15761583

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp