Skip to content

Commit 9fa31e7

Browse 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

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

reference/constraints/Unique.rst

Lines 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)