Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6f8439b

Browse filesBrowse files
committed
[symfony#2797] Minor tweaks to new UniqueEntity.errorPath docs
1 parent 802a8c7 commit 6f8439b
Copy full SHA for 6f8439b

File tree

Expand file treeCollapse file tree

1 file changed

+5
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-8
lines changed

‎reference/constraints/UniqueEntity.rst

Copy file name to clipboardExpand all lines: reference/constraints/UniqueEntity.rst
+5-8Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ errorPath
160160
.. versionadded:: 2.1
161161
The ``errorPath`` option was added in Symfony 2.1.
162162

163-
If the entity violates against this constraint the error message is bound to
164-
the first field. If there are more than one fields it may be desired to bind the
165-
error message to another field.
163+
If the entity violates constraint the error message is bound to the first
164+
field in `fields`_. If there are more than one fields, you may want to map
165+
the error message to another field.
166166

167167
Consider this example:
168168

@@ -174,7 +174,7 @@ Consider this example:
174174
Acme\AdministrationBundle\Entity\Service:
175175
constraints:
176176
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
177-
fields: [ host, port ]
177+
fields: [host, port]
178178
errorPath: port
179179
message: 'This port is already in use on that host.'
180180
@@ -251,7 +251,7 @@ Consider this example:
251251
}
252252
}
253253
254-
Now, the message would be bound to the form field of the ``port`` with this configuration.
254+
Now, the message would be bound to the ``port`` field with this configuration.
255255

256256

257257
ignoreNull
@@ -266,6 +266,3 @@ If this option is set to ``true``, then the constraint will allow multiple
266266
entities to have a ``null`` value for a field without failing validation.
267267
If set to ``false``, only one ``null`` value is allowed - if a second entity
268268
also has a ``null`` value, validation would fail.
269-
270-
271-
.. _`field`: `fields`_

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.