Skip to content

Fix "age" to "dateOfBirth" in LessThanOrEqual.rst #11595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions reference/constraints/LessThanOrEqual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ that a date must be today or in the past like this:
/**
* @Assert\LessThanOrEqual("today")
*/
protected $age;
protected $dateOfBirth;
}

.. code-block:: yaml

# src/AppBundle/Resources/config/validation.yml
AppBundle\Entity\Person:
properties:
age:
dateOfBirth:
- LessThanOrEqual: today

.. code-block:: xml
Expand All @@ -145,7 +145,7 @@ that a date must be today or in the past like this:
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping https://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">

<class name="AppBundle\Entity\Person">
<property name="age">
<property name="dateOfBirth">
<constraint name="LessThanOrEqual">today</constraint>
</property>
</class>
Expand All @@ -163,7 +163,7 @@ that a date must be today or in the past like this:
{
public static function loadValidatorMetadata(ClassMetadata $metadata)
{
$metadata->addPropertyConstraint('age', new Assert\LessThanOrEqual('today'));
$metadata->addPropertyConstraint('dateOfBirth', new Assert\LessThanOrEqual('today'));
}
}

Expand All @@ -184,15 +184,15 @@ dates. If you want to fix the timezone, append it to the date string:
/**
* @Assert\LessThanOrEqual("today UTC")
*/
protected $age;
protected $dateOfBirth;
}

.. code-block:: yaml

# src/AppBundle/Resources/config/validation.yml
AppBundle\Entity\Person:
properties:
age:
dateOfBirth:
- LessThanOrEqual: today UTC

.. code-block:: xml
Expand All @@ -204,7 +204,7 @@ dates. If you want to fix the timezone, append it to the date string:
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping https://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">

<class name="AppBundle\Entity\Person">
<property name="age">
<property name="dateOfBirth">
<constraint name="LessThanOrEqual">today UTC</constraint>
</property>
</class>
Expand All @@ -222,7 +222,7 @@ dates. If you want to fix the timezone, append it to the date string:
{
public static function loadValidatorMetadata(ClassMetadata $metadata)
{
$metadata->addPropertyConstraint('age', new Assert\LessThanOrEqual('today UTC'));
$metadata->addPropertyConstraint('dateOfBirth', new Assert\LessThanOrEqual('today UTC'));
}
}

Expand All @@ -243,15 +243,15 @@ can check that a person must be at least 18 years old like this:
/**
* @Assert\LessThanOrEqual("-18 years")
*/
protected $age;
protected $dateOfBirth;
}

.. code-block:: yaml

# src/AppBundle/Resources/config/validation.yml
AppBundle\Entity\Person:
properties:
age:
dateOfBirth:
- LessThanOrEqual: -18 years

.. code-block:: xml
Expand All @@ -263,7 +263,7 @@ can check that a person must be at least 18 years old like this:
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping https://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">

<class name="AppBundle\Entity\Person">
<property name="age">
<property name="dateOfBirth">
<constraint name="LessThanOrEqual">-18 years</constraint>
</property>
</class>
Expand All @@ -281,7 +281,7 @@ can check that a person must be at least 18 years old like this:
{
public static function loadValidatorMetadata(ClassMetadata $metadata)
{
$metadata->addPropertyConstraint('age', new Assert\LessThanOrEqual('-18 years'));
$metadata->addPropertyConstraint('dateOfBirth', new Assert\LessThanOrEqual('-18 years'));
}
}

Expand Down