Skip to content

Commit

Permalink
Update reference documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasferber committed Feb 18, 2015
1 parent ce816ad commit 60582e7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
22 changes: 22 additions & 0 deletions doc/reference/annotations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,28 @@ This annotation can be defined on a property to specifiy to if the property
should be serialized when only serializing specific groups (see
:doc:`../cookbook/exclusion_strategies`).

@RecursionGroups
~~~~~~~~~~~~~~~~

This annotation can be defined on a property to modify the active
serialization groups when descending into referenced subobjects. You can
replace the whole list or add and remove groups from the list.

.. code-block :: php
<?php
use JMS\Serializer\Annotation\RecursionGroups
class User
{
private $id;
/** @RecursionGroups(set={"group"}, add={"Default"}, remove={"Default"}) */
private $name;
// ...
}
@MaxDepth
~~~~~~~~~
This annotation can be defined on a property to limit the depth to which the
Expand Down
3 changes: 3 additions & 0 deletions doc/reference/xml_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ XML Reference
xml-key-value-pairs="true"
xml-attribute-map="true"
max-depth="2"
recursion-groups-set="foo,bar"
recursion-groups-add="foo,bar"
recursion-groups-remove="foo,bar"
>
<!-- You can also specify the type as element which is necessary if
your type contains "<" or ">" characters. -->
Expand Down
4 changes: 4 additions & 0 deletions doc/reference/yml_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ YAML Reference
cdata: false
namespace: http://www.w3.org/2005/Atom
max_depth: 2
recursion_groups:
set: [foo, bar]
add: [foo, bar]
remove: [foo, bar]

handler_callbacks:
serialization:
Expand Down

0 comments on commit 60582e7

Please # to comment.