From 76504c174d58f2aef3ebbefd2646adf544ac8243 Mon Sep 17 00:00:00 2001 From: Olivier PARPAILLON Date: Fri, 22 Nov 2024 16:48:04 +0100 Subject: [PATCH] GreaterThan --- src/Entity/Sortie.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Entity/Sortie.php b/src/Entity/Sortie.php index 9fb3c5e..c00a6d2 100644 --- a/src/Entity/Sortie.php +++ b/src/Entity/Sortie.php @@ -7,6 +7,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; +use Symfony\Component\Validator\Constraints as Assert; #[ORM\Entity(repositoryClass: SortieRepository::class)] class Sortie @@ -21,12 +22,14 @@ class Sortie private ?string $nom = null; #[ORM\Column(type: Types::DATETIME_IMMUTABLE, nullable: true)] + #[Assert\GreaterThan(propertyPath: 'dateLimiteInscription')] private ?\DateTimeInterface $dateHeureDebut = null; #[ORM\Column(nullable: true)] private ?int $duree = null; #[ORM\Column(type: Types::DATETIME_IMMUTABLE, nullable: true)] + #[Assert\GreaterThan("today")] private ?\DateTimeInterface $dateLimiteInscription = null; #[ORM\Column(nullable: true)]