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 9fa31e7

Browse filesBrowse files
committed
minor #16771 [Validator] Fix typo in the Unique constraint (wkania)
This PR was merged into the 6.1 branch. Discussion ---------- [Validator] Fix typo in the Unique constraint `@wouterj` just a small fix related to the #16713 (comment) Commits ------- 3fd53b9 Fix typo in the Unique constraint
2 parents 1cbcf11 + 3fd53b9 commit 9fa31e7
Copy full SHA for 9fa31e7

File tree

Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-4
lines changed

‎reference/constraints/Unique.rst

Copy file name to clipboardExpand all lines: reference/constraints/Unique.rst
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ collection::
157157
# config/validator/validation.yaml
158158
App\Entity\Poi:
159159
properties:
160-
contactEmails:
160+
coordinates:
161161
- Unique:
162162
fields: [latitude, longitude]
163163
@@ -172,8 +172,10 @@ collection::
172172
<class name="App\Entity\Poi">
173173
<property name="coordinates">
174174
<constraint name="Unique">
175-
<field>latitude</field>
176-
<field>longitude</field>
175+
<option name="fields">
176+
<value>latitude</value>
177+
<value>longitude</value>
178+
</option>
177179
</constraint>
178180
</property>
179181
</class>
@@ -191,7 +193,7 @@ collection::
191193
{
192194
public static function loadValidatorMetadata(ClassMetadata $metadata)
193195
{
194-
$metadata->addPropertyConstraint('contactEmails', new Assert\Unique([
196+
$metadata->addPropertyConstraint('coordinates', new Assert\Unique([
195197
'fields' => ['latitude', 'longitude'],
196198
]));
197199
}

0 commit comments

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