mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 18:43:49 +00:00
PersonMoveEventSubscriber: handle case when the move is before the last
locationHistory, but the move affects "now"
This commit is contained in:
@@ -61,8 +61,18 @@ class PersonMoveEventSubscriber implements EventSubscriberInterface
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($period->getPersonLocation() === $person
|
||||
&& $event->getMoveDate() >= $period->getLastLocationHistory()->getStartDate()
|
||||
$now = new \DateTimeImmutable('now');
|
||||
|
||||
if (
|
||||
$period->getPersonLocation() === $person
|
||||
&&
|
||||
(
|
||||
$event->getMoveDate() >= $period->getLastLocationHistory()->getStartDate()
|
||||
|| (
|
||||
$event->getNextAddress()->getValidFrom() < $now
|
||||
&& (null === $event->getNextAddress()->getValidTo() || $event->getNextAddress()->getValidTo() > $now)
|
||||
)
|
||||
)
|
||||
&& null !== $period->getUser()
|
||||
&& $period->getUser() !== $this->security->getUser()
|
||||
) {
|
||||
|
Reference in New Issue
Block a user