mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
fix validation groups and sequential validator msg
This commit is contained in:
@@ -29,7 +29,7 @@ class HouseholdMembershipSequentialValidator extends ConstraintValidator
|
||||
throw new UnexpectedTypeException($constraint, Person::class);
|
||||
}
|
||||
|
||||
$participations = $person->getHouseholdParticipations();
|
||||
$participations = $person->getHouseholdParticipationsShareHousehold();
|
||||
|
||||
if ($participations->count() === 0) {
|
||||
return;
|
||||
@@ -47,6 +47,7 @@ class HouseholdMembershipSequentialValidator extends ConstraintValidator
|
||||
if ($covers->hasIntersections()) {
|
||||
foreach ($covers->getIntersections() as list($start, $end, $metadata)) {
|
||||
$participation = $participations[$metadata[0]];
|
||||
$nbHousehold = count($metadata);
|
||||
|
||||
$this->context
|
||||
->buildViolation("household_membership.Person with membership covering")
|
||||
@@ -55,7 +56,9 @@ class HouseholdMembershipSequentialValidator extends ConstraintValidator
|
||||
$participation->getPerson(), []
|
||||
),
|
||||
// TODO when date is correctly i18n, fix this
|
||||
'%from%' => $start->format('d-m-Y')
|
||||
'%from%' => $start->format('d-m-Y'),
|
||||
'%nbHousehold%' => $nbHousehold,
|
||||
|
||||
])
|
||||
->addViolation()
|
||||
;
|
||||
|
Reference in New Issue
Block a user