@@ -630,8 +630,9 @@ having unique identifiers::
630
630
Handling Serialization Depth
631
631
----------------------------
632
632
633
- The Serializer component is able to detect and limit the serialization depth. It is especially useful when
634
- serializing large trees. Assume the following data structure::
633
+ The Serializer component is able to detect and limit the serialization depth.
634
+ It is especially useful when serializing large trees. Assume the following data
635
+ structure::
635
636
636
637
namespace Acme;
637
638
@@ -656,8 +657,8 @@ serializing large trees. Assume the following data structure::
656
657
$level3->foo = 'level3';
657
658
$level2->child = $level3;
658
659
659
- The serializer can be configured to set a maximum depth for a given property. Here, we set it to 2 for the `` $child ``
660
- property:
660
+ The serializer can be configured to set a maximum depth for a given property.
661
+ Here, we set it to 2 for the `` $child `` property:
661
662
662
663
.. configuration-block ::
663
664
@@ -698,12 +699,15 @@ property:
698
699
</attribute >
699
700
</serializer >
700
701
701
- The metadata loader corresponding to the chosen format must be configured in order to use this feature.
702
- It is done automatically when using the Symfony Standard Edition. When using the standalone component, refer
703
- to :ref: `the groups documentation <component-serializer-attributes-groups >` to learn how to do that.
702
+ The metadata loader corresponding to the chosen format must be configured in
703
+ order to use this feature. It is done automatically when using the Symfony
704
+ Standard Edition. When using the standalone component, refer to
705
+ :ref: `the groups documentation <component-serializer-attributes-groups >` to
706
+ learn how to do that.
704
707
705
- The check is only done if the `enable_max_depth ` key of the serializer context is set to ``true ``. In the following
706
- example, the third level is not serialized because it is deeper than the configured maximum depth (2)::
708
+ The check is only done if the ``enable_max_depth `` key of the serializer context
709
+ is set to ``true ``. In the following example, the third level is not serialized
710
+ because it is deeper than the configured maximum depth of 2::
707
711
708
712
$result = $serializer->normalize($level1, null, array('enable_max_depth' => true));
709
713
/*
0 commit comments