8000 Documented the propertyPath option of the comparison constraints · symfony/symfony-docs@f856772 · GitHub
[go: up one dir, main page]

Skip to content

Commit f856772

Browse files
committed
Documented the propertyPath option of the comparison constraints
1 parent f8ddf1f commit f856772

File tree

9 files changed

+34
-0
lines changed

9 files changed

+34
-0
lines changed

reference/constraints/EqualTo.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ To force that a value is *not* equal, see :doc:`/reference/constraints/NotEqualT
1616
| Options | - `value`_ |
1717
| | - `message`_ |
1818
| | - `payload`_ |
19+
| | - `propertyPath`_ |
1920
+----------------+-----------------------------------------------------------------------+
2021
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\EqualTo` |
2122
+----------------+-----------------------------------------------------------------------+
@@ -118,3 +119,5 @@ message
118119
This is the message that will be shown if the value is not equal.
119120

120121
.. include:: /reference/constraints/_payload-option.rst.inc
122+
123+
.. include:: /reference/constraints/_comparison-propertypath-option.rst.inc

reference/constraints/GreaterThan.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ than another value, see :doc:`/reference/constraints/LessThan`.
1212
| Options | - `value`_ |
1313
| | - `message`_ |
1414
| | - `payload`_ |
15+
| | - `propertyPath`_ |
1516
+----------------+---------------------------------------------------------------------------+
1617
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\GreaterThan` |
1718
+----------------+---------------------------------------------------------------------------+
@@ -301,4 +302,6 @@ comparison value.
301302

302303
.. include:: /reference/constraints/_payload-option.rst.inc
303304

305+
.. include:: /reference/constraints/_comparison-propertypath-option.rst.inc
306+
304307
.. _`accepted by the DateTime constructor`: http://www.php.net/manual/en/datetime.formats.php

reference/constraints/GreaterThanOrEqual.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ the options. To force that a value is greater than another value, see
1111
| Options | - `value`_ |
1212
| | - `message`_ |
1313
| | - `payload`_ |
14+
| | - `propertyPath`_ |
1415
+----------------+----------------------------------------------------------------------------------+
1516
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\GreaterThanOrEqual` |
1617
+----------------+----------------------------------------------------------------------------------+
@@ -299,4 +300,6 @@ to the comparison value.
299300

300301
.. include:: /reference/constraints/_payload-option.rst.inc
301302

303+
.. include:: /reference/constraints/_comparison-propertypath-option.rst.inc
304+
302305
.. _`accepted by the DateTime constructor`: http://www.php.net/manual/en/datetime.formats.php

reference/constraints/IdenticalTo.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ To force that a value is *not* identical, see
1717
| Options | - `value`_ |
1818
| | - `message`_ |
1919
| | - `payload`_ |
20+
| | - `propertyPath`_ |
2021
+----------------+--------------------------------------------------------------------------+
2122
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\IdenticalTo` |
2223
+----------------+--------------------------------------------------------------------------+
@@ -112,3 +113,5 @@ message
112113
This is the message that will be shown if the value is not identical.
113114

114115
.. include:: /reference/constraints/_payload-option.rst.inc
116+
117+
.. include:: /reference/constraints/_comparison-propertypath-option.rst.inc

reference/constraints/LessThan.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ than another value, see :doc:`/reference/constraints/GreaterThan`.
1212
| Options | - `value`_ |
1313
| | - `message`_ |
1414
| | - `payload`_ |
15+
| | - `propertyPath`_ |
1516
+----------------+------------------------------------------------------------------------+
1617
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\LessThan` |
1718
+----------------+------------------------------------------------------------------------+
@@ -300,4 +301,6 @@ comparison value.
300301

301302
.. include:: /reference/constraints/_payload-option.rst.inc
302303

304+
.. include:: /reference/constraints/_comparison-propertypath-option.rst.inc
305+
303306
.. _`accepted by the DateTime constructor`: http://www.php.net/manual/en/datetime.formats.php

reference/constraints/LessThanOrEqual.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ options. To force that a value is less than another value, see
1111
| Options | - `value`_ |
1212
| | - `message`_ |
1313
| | - `payload`_ |
14+
| | - `propertyPath`_ |
1415
+----------------+-------------------------------------------------------------------------------+
1516
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\LessThanOrEqual` |
1617
+----------------+-------------------------------------------------------------------------------+
@@ -298,4 +299,6 @@ to the comparison value.
298299

299300
.. include:: /reference/constraints/_payload-option.rst.inc
300301

302+
.. include:: /reference/constraints/_comparison-propertypath-option.rst.inc
303+
301304
.. _`accepted by the DateTime constructor`: http://www.php.net/manual/en/datetime.formats.php

reference/constraints/NotEqualTo.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ options. To force that a value is equal, see
1717
| Options | - `value`_ |
1818
| | - `message`_ |
1919
| | - `payload`_ |
20+
| | - `propertyPath`_ |
2021
+----------------+-------------------------------------------------------------------------+
2122
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\NotEqualTo` |
2223
+----------------+-------------------------------------------------------------------------+
@@ -120,3 +121,5 @@ message
120121
This is the message that will be shown if the value is equal.
121122

122123
.. include:: /reference/constraints/_payload-option.rst.inc
124+
125+
.. include:: /reference/constraints/_comparison-propertypath-option.rst.inc

reference/constraints/NotIdenticalTo.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ the options. To force that a value is identical, see
1717
| Options | - `value`_ |
1818
| | - `message`_ |
1919
| | - `payload`_ |
20+
| | - `propertyPath`_ |
2021
+----------------+-----------------------------------------------------------------------------+
2122
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\NotIdenticalTo` |
2223
+----------------+-----------------------------------------------------------------------------+
@@ -121,3 +122,5 @@ message
121122
This is the message that will be shown if the value is identical.
122123

123124
.. include:: /reference/constraints/_payload-option.rst.inc
125+
126+
.. include:: /reference/constraints/_comparison-propertypath-option.rst.inc
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
propertyPath
2+
~~~~~~~~~~~~
3+
4+
**type**: ``string``
5+
6+
It defines the object property whose value is used to make the comparison.
7+
8+
For example, if you want to compare the ``$endDate`` property of some object
9+
with regard to the ``$startDate`` property of the same object, use
10+
``propertyPath="startDate"`` in the comparison constraint of ``$endDate``.

0 commit comments

Comments
 (0)
0