Skip to content

Documented the propertyPath option of the comparison constraints #8531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions reference/constraints/EqualTo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ To force that a value is *not* equal, see :doc:`/reference/constraints/NotEqualT
| Options | - `value`_ |
| | - `message`_ |
| | - `payload`_ |
| | - `propertyPath`_ |
+----------------+-----------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\EqualTo` |
+----------------+-----------------------------------------------------------------------+
Expand Down Expand Up @@ -118,3 +119,5 @@ message
This is the message that will be shown if the value is not equal.

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

.. include:: /reference/constraints/_comparison-propertypath-option.rst.inc
3 changes: 3 additions & 0 deletions reference/constraints/GreaterThan.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ than another value, see :doc:`/reference/constraints/LessThan`.
| Options | - `value`_ |
| | - `message`_ |
| | - `payload`_ |
| | - `propertyPath`_ |
+----------------+---------------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\GreaterThan` |
+----------------+---------------------------------------------------------------------------+
Expand Down Expand Up @@ -301,4 +302,6 @@ comparison value.

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

.. include:: /reference/constraints/_comparison-propertypath-option.rst.inc

.. _`accepted by the DateTime constructor`: http://www.php.net/manual/en/datetime.formats.php
3 changes: 3 additions & 0 deletions reference/constraints/GreaterThanOrEqual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ the options. To force that a value is greater than another value, see
| Options | - `value`_ |
| | - `message`_ |
| | - `payload`_ |
| | - `propertyPath`_ |
+----------------+----------------------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\GreaterThanOrEqual` |
+----------------+----------------------------------------------------------------------------------+
Expand Down Expand Up @@ -299,4 +300,6 @@ to the comparison value.

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

.. include:: /reference/constraints/_comparison-propertypath-option.rst.inc

.. _`accepted by the DateTime constructor`: http://www.php.net/manual/en/datetime.formats.php
3 changes: 3 additions & 0 deletions reference/constraints/IdenticalTo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ To force that a value is *not* identical, see
| Options | - `value`_ |
| | - `message`_ |
| | - `payload`_ |
| | - `propertyPath`_ |
+----------------+--------------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\IdenticalTo` |
+----------------+--------------------------------------------------------------------------+
Expand Down Expand Up @@ -112,3 +113,5 @@ message
This is the message that will be shown if the value is not identical.

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

.. include:: /reference/constraints/_comparison-propertypath-option.rst.inc
3 changes: 3 additions & 0 deletions reference/constraints/LessThan.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ than another value, see :doc:`/reference/constraints/GreaterThan`.
| Options | - `value`_ |
| | - `message`_ |
| | - `payload`_ |
| | - `propertyPath`_ |
+----------------+------------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\LessThan` |
+----------------+------------------------------------------------------------------------+
Expand Down Expand Up @@ -300,4 +301,6 @@ comparison value.

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

.. include:: /reference/constraints/_comparison-propertypath-option.rst.inc

.. _`accepted by the DateTime constructor`: http://www.php.net/manual/en/datetime.formats.php
3 changes: 3 additions & 0 deletions reference/constraints/LessThanOrEqual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ options. To force that a value is less than another value, see
| Options | - `value`_ |
| | - `message`_ |
| | - `payload`_ |
| | - `propertyPath`_ |
+----------------+-------------------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\LessThanOrEqual` |
+----------------+-------------------------------------------------------------------------------+
Expand Down Expand Up @@ -298,4 +299,6 @@ to the comparison value.

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

.. include:: /reference/constraints/_comparison-propertypath-option.rst.inc

.. _`accepted by the DateTime constructor`: http://www.php.net/manual/en/datetime.formats.php
3 changes: 3 additions & 0 deletions reference/constraints/NotEqualTo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ options. To force that a value is equal, see
| Options | - `value`_ |
| | - `message`_ |
| | - `payload`_ |
| | - `propertyPath`_ |
+----------------+-------------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\NotEqualTo` |
+----------------+-------------------------------------------------------------------------+
Expand Down Expand Up @@ -120,3 +121,5 @@ message
This is the message that will be shown if the value is equal.

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

.. include:: /reference/constraints/_comparison-propertypath-option.rst.inc
3 changes: 3 additions & 0 deletions reference/constraints/NotIdenticalTo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ the options. To force that a value is identical, see
| Options | - `value`_ |
| | - `message`_ |
| | - `payload`_ |
| | - `propertyPath`_ |
+----------------+-----------------------------------------------------------------------------+
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\NotIdenticalTo` |
+----------------+-----------------------------------------------------------------------------+
Expand Down Expand Up @@ -121,3 +122,5 @@ message
This is the message that will be shown if the value is identical.

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

.. include:: /reference/constraints/_comparison-propertypath-option.rst.inc
10 changes: 10 additions & 0 deletions reference/constraints/_comparison-propertypath-option.rst.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
propertyPath
~~~~~~~~~~~~

**type**: ``string``

It defines the object property whose value is used to make the comparison.

For example, if you want to compare the ``$endDate`` property of some object
with regard to the ``$startDate`` property of the same object, use
``propertyPath="startDate"`` in the comparison constraint of ``$endDate``.