We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c368140 commit 02b7732Copy full SHA for 02b7732
components/serializer.rst
@@ -408,9 +408,9 @@ and :class:`Symfony\\Component\\Serializer\\Normalizer\\PropertyNormalizer`::
408
$obj->name = 'Acme Inc.';
409
$obj->address = '123 Main Street, Big City';
410
411
- $json = $serializer->serialize($obj);
+ $json = $serializer->serialize($obj, 'json');
412
// {"org_name": "Acme Inc.", "org_address": "123 Main Street, Big City"}
413
- $objCopy = $serializer->deserialize($json);
+ $objCopy = $serializer->deserialize($json, Company::class, 'json');
414
// Same data as $obj
415
416
.. _using-camelized-method-names-for-underscored-attributes:
0 commit comments