holder: fix when repositionning/moving member on same day

* if holder has not the index '0', validator fails. Use the method
Collection::first
* change constraint to allow a move on household on same day
This commit is contained in:
2021-12-16 16:57:49 +01:00
parent 751a418c1f
commit b613a2f49b
3 changed files with 37 additions and 1 deletions

View File

@@ -29,7 +29,7 @@ class MaxHolderValidator extends ConstraintValidator
$covers = new DateRangeCovering(
self::MAX_HOLDERS,
$holders[0]->getStartDate()->getTimezone()
$holders->first()->getStartDate()->getTimezone()
);
foreach ($holders as $key => $member) {