8000 Fix typo in the Unique constraint · symfony/symfony-docs@3fd53b9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3fd53b9

Browse files
committed
Fix typo in the Unique constraint
1 parent 082570a commit 3fd53b9

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