From 45dc8ed6613b820b79ecdc10d9dc5468791e7f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 11 Jun 2021 17:08:35 +0200 Subject: [PATCH] apply maxHolder constraint on houehold --- src/Bundle/ChillPersonBundle/Entity/Household/Household.php | 2 ++ .../Validator/Constraints/Household/MaxHolder.php | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php index fb0c2b110..b9eba8e9c 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php @@ -9,6 +9,7 @@ use Doctrine\Common\Collections\Criteria; use Symfony\Component\Serializer\Annotation as Serializer; use Chill\MainBundle\Entity\Address; use Chill\PersonBundle\Entity\Household\HouseholdMember; +use Chill\PersonBundle\Validator\Constraints\Household\MaxHolder; /** * @ORM\Entity @@ -18,6 +19,7 @@ use Chill\PersonBundle\Entity\Household\HouseholdMember; * @Serializer\DiscriminatorMap(typeProperty="type", mapping={ * "household"=Household::class * }) + * @MasHolder() */ class Household { diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/MaxHolder.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/MaxHolder.php index 2c89b90cf..6b56fe1ce 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/MaxHolder.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/MaxHolder.php @@ -4,7 +4,9 @@ namespace Chill\PersonBundle\Validator\Constraints\Household; use Symfony\Component\Validator\Constraint; - +/** + * @Annotation + */ class MaxHolder extends Constraint { public $message = 'household.max_holder_overflowed';