diff --git a/reference/constraints/Collection.rst b/reference/constraints/Collection.rst index 4e709f1d9c0..1dde4458f85 100644 --- a/reference/constraints/Collection.rst +++ b/reference/constraints/Collection.rst @@ -179,6 +179,22 @@ field is optional but must be a valid email if supplied, you can do the followin .. configuration-block:: + .. code-block:: yaml + + # src/Acme/BlogBundle/Resources/config/validation.yml + Acme\BlogBundle\Entity\Author: + properties: + profile_data: + - Collection: + fields: + personal_email: + - Collection\Required + - NotBlank: ~ + - Email: ~ + alternate_email: + - Collection\Optional: + - Email: ~ + .. code-block:: php-annotations // src/Acme/BlogBundle/Entity/Author.php @@ -200,6 +216,35 @@ field is optional but must be a valid email if supplied, you can do the followin 'personal_email', ); } + + .. code-block:: xml + + + + + + + + + + + + + .. code-block:: php