Skip to content

Commit 23838fd

Browse files
thibaut22200javiereguiluz
authored andcommitted
[Validator] Add errorPath to Unique constraint
1 parent dae3dfe commit 23838fd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

reference/constraints/Unique.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ collection::
170170
171171
.. include:: /reference/constraints/_groups-option.rst.inc
172172

173+
``errorPath``
174+
~~~~~~~~~~~~~
175+
176+
**type**: ``string`` **default**: ``null``
177+
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"``
181+
173182
``message``
174183
~~~~~~~~~~~
175184

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy