Christian Stocker 13 лет назад
Родитель
Сommit
bbaee82224

+ 12 - 0
Resources/doc/reference/annotations.rst

@@ -46,6 +46,18 @@ property was available. If a later version is serialized, then this property is
 excluded automatically. The version must be in a format that is understood by
 PHP's ``version_compare`` function.
 
+@Groups
+-------
+
+This annotation can be defined on a property to specifiy if this porperty should 
+be serialized, if any group is specified with the 
+``$serializer->setGroups(array("Foo"))`` method. Both values always have to be 
+an array.
+
+.. code-block :: php
+
+  /** @Groups({"Foo","Bar"}) */
+
 @AccessType
 ~~~~~~~~~~~
 This annotation can be defined on a property, or a class to specify in which way

+ 1 - 0
Resources/doc/reference/xml_reference.rst

@@ -21,6 +21,7 @@ XML Reference
                       accessor-setter="setSomeProperty"
                       inline="true"
                       read-only="true"
+                      groups="foo,bar"
             >
                 <!-- You can also specify the type as element which is necessary if
                      your type contains "<" or ">" characters. -->

+ 1 - 0
Resources/doc/reference/yml_reference.rst

@@ -19,6 +19,7 @@ YAML Reference
                 serialized_name: foo
                 since_version: 1.0
                 until_version: 1.1
+                groups: [foo, bar]
                 xml_attribute: true
                 inline: true
                 read_only: true