From 1921a9fab3f6ace8e3d35ee519a46b3b8b5db01d Mon Sep 17 00:00:00 2001 From: inso Date: Mon, 20 Oct 2014 21:36:20 +0300 Subject: [PATCH] Updated Valid constraint reference --- reference/constraints/Valid.rst | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/reference/constraints/Valid.rst b/reference/constraints/Valid.rst index 407c5339cbc..5cf5f0283e3 100644 --- a/reference/constraints/Valid.rst +++ b/reference/constraints/Valid.rst @@ -1,6 +1,10 @@ Valid ===== +.. caution:: + + The ``deep`` option is deprecated since Symfony 2.5 and will be removed in Symfony 3.0. + This constraint is used to enable validation on objects that are embedded as properties on an object being validated. This allows you to validate an object and all sub-objects associated with it. @@ -9,9 +13,9 @@ object and all sub-objects associated with it. | Applies to | :ref:`property or method ` | +----------------+---------------------------------------------------------------------+ | Options | - `traverse`_ | -| | - `message`_ | +| | - `deep`_ | +----------------+---------------------------------------------------------------------+ -| Class | :class:`Symfony\\Component\\Validator\\Constraints\\Type` | +| Class | :class:`Symfony\\Component\\Validator\\Constraints\\Valid` | +----------------+---------------------------------------------------------------------+ .. include:: /reference/forms/types/options/_error_bubbling_hint.rst.inc @@ -267,9 +271,11 @@ If this constraint is applied to a property that holds an array of objects, then each object in that array will be validated only if this option is set to ``true``. -message +deep ~~~~~~~ -**type**: ``string`` **default**: ``This value should be true.`` +**type**: ``boolean`` **default**: ``false`` -This is the message that will be shown if the value is false. +If this constraint is applied to a property that holds an array of objects, +then each object in that array will be validated recursively if this option is set +to ``true``.