mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-17 07:44:24 +00:00
32 lines
862 B
PHP
32 lines
862 B
PHP
<?php
|
|
|
|
/**
|
|
* Chill is a software for social workers
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Chill\PersonBundle\Validator\Constraints\Person;
|
|
|
|
use Symfony\Component\Validator\Constraint;
|
|
|
|
/**
|
|
* Create a constraint on birth date: the birthdate after today are not allowed.
|
|
*
|
|
* It is possible to add a delay before today, expressed as described in
|
|
* interval_spec : http://php.net/manual/en/dateinterval.construct.php
|
|
* (this interval_spec itself is based on ISO8601 :
|
|
* https://en.wikipedia.org/wiki/ISO_8601#Durations)
|
|
*
|
|
* @Annotation
|
|
*/
|
|
class Birthdate extends Constraint
|
|
{
|
|
public const BIRTHDATE_INVALID_CODE = '3f42fd96-0b2d-11ec-8cf3-0f3b1b1ca1c4';
|
|
|
|
public $message = 'The birthdate must be before %date%';
|
|
}
|