Skip to content

Commit 03713d5

Browse files
committed
Reword
1 parent f979cd1 commit 03713d5

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

reference/constraints/Unique.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,16 @@ collection::
175175

176176
**type**: ``string`` **default**: ``null``
177177

178-
This option allows you to define a custom path for your message.
179-
``#[Assert\Unique(fields: ['latitude', 'longitude'], errorPath: 'point_of_interest')]``
180-
Instead of ``0: "Error message"``, it will be : ``0.point_of_interest: "Error message"``
178+
.. versionadded:: 7.2
179+
180+
The ``errorPath`` option was introduced in Symfony 7.2.
181+
182+
If a validation error occurs, the error message is, by default, bound to the
183+
first element in the collection. Use this option to bind the error message to a
184+
specific field within the first item of the collection.
185+
186+
The value of this option must use any :doc:`valid PropertyAccess syntax </components/property_access>`
187+
(e.g. ``'point_of_interest'``, ``'user.email'``).
181188

182189
``message``
183190
~~~~~~~~~~~

0 commit comments

Comments
 (0)