Skip to content

Commit df98545

Browse files
committed
Merge branch '3.4' into 4.2
* 3.4: Fix "age" to "dateOfBith" in LessThanOrEqual.rst
2 parents cf458de + a4a4281 commit df98545

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

reference/constraints/LessThanOrEqual.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ that a date must be today or in the past like this:
122122
/**
123123
* @Assert\LessThanOrEqual("today")
124124
*/
125-
protected $age;
125+
protected $dateOfBirth;
126126
}
127127
128128
.. code-block:: yaml
129129
130130
# config/validator/validation.yaml
131131
App\Entity\Person:
132132
properties:
133-
age:
133+
dateOfBirth:
134134
- LessThanOrEqual: today
135135
136136
.. code-block:: xml
@@ -142,7 +142,7 @@ that a date must be today or in the past like this:
142142
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping https://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
143143
144144
<class name="App\Entity\Person">
145-
<property name="age">
145+
<property name="dateOfBirth">
146146
<constraint name="LessThanOrEqual">today</constraint>
147147
</property>
148148
</class>
@@ -160,7 +160,7 @@ that a date must be today or in the past like this:
160160
{
161161
public static function loadValidatorMetadata(ClassMetadata $metadata)
162162
{
163-
$metadata->addPropertyConstraint('age', new Assert\LessThanOrEqual('today'));
163+
$metadata->addPropertyConstraint('dateOfBirth', new Assert\LessThanOrEqual('today'));
164164
}
165165
}
166166
@@ -181,15 +181,15 @@ dates. If you want to fix the timezone, append it to the date string:
181181
/**
182182
* @Assert\LessThanOrEqual("today UTC")
183183
*/
184-
protected $age;
184+
protected $dateOfBirth;
185185
}
186186
187187
.. code-block:: yaml
188188
189189
# config/validator/validation.yaml
190190
App\Entity\Person:
191191
properties:
192-
age:
192+
dateOfBirth:
193193
- LessThanOrEqual: today UTC
194194
195195
.. code-block:: xml
@@ -201,7 +201,7 @@ dates. If you want to fix the timezone, append it to the date string:
201201
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping https://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
202202
203203
<class name="App\Entity\Person">
204-
<property name="age">
204+
<property name="dateOfBirth">
205205
<constraint name="LessThanOrEqual">today UTC</constraint>
206206
</property>
207207
</class>
@@ -219,7 +219,7 @@ dates. If you want to fix the timezone, append it to the date string:
219219
{
220220
public static function loadValidatorMetadata(ClassMetadata $metadata)
221221
{
222-
$metadata->addPropertyConstraint('age', new Assert\LessThanOrEqual('today UTC'));
222+
$metadata->addPropertyConstraint('dateOfBirth', new Assert\LessThanOrEqual('today UTC'));
223223
}
224224
}
225225
@@ -240,15 +240,15 @@ can check that a person must be at least 18 years old like this:
240240
/**
241241
* @Assert\LessThanOrEqual("-18 years")
242242
*/
243-
protected $age;
243+
protected $dateOfBirth;
244244
}
245245
246246
.. code-block:: yaml
247247
248248
# config/validator/validation.yaml
249249
App\Entity\Person:
250250
properties:
251-
age:
251+
dateOfBirth:
252252
- LessThanOrEqual: -18 years
253253
254254
.. code-block:: xml
@@ -260,7 +260,7 @@ can check that a person must be at least 18 years old like this:
260260
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping https://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
261261
262262
<class name="App\Entity\Person">
263-
<property name="age">
263+
<property name="dateOfBirth">
264264
<constraint name="LessThanOrEqual">-18 years</constraint>
265265
</property>
266266
</class>
@@ -278,7 +278,7 @@ can check that a person must be at least 18 years old like this:
278278
{
279279
public static function loadValidatorMetadata(ClassMetadata $metadata)
280280
{
281-
$metadata->addPropertyConstraint('age', new Assert\LessThanOrEqual('-18 years'));
281+
$metadata->addPropertyConstraint('dateOfBirth', new Assert\LessThanOrEqual('-18 years'));
282282
}
283283
}
284284

0 commit comments

Comments
 (0)