#365 Add works and activities counter

This commit is contained in:
juminet
2025-04-14 09:34:02 +00:00
committed by Julien Fastré
parent 1c1f418b18
commit 40e373a9c7
9 changed files with 92 additions and 13 deletions

View File

@@ -511,6 +511,14 @@ class AccompanyingPeriod implements
return $this->getParticipationsContainsPerson($person)->count() > 0;
}
public function getOpenWorks(): Collection
{
return $this->getWorks()->filter(
static fn (AccompanyingPeriodWork $work): bool => null === $work->getEndDate()
or $work->getEndDate() > new \DateTimeImmutable('today')
);
}
/**
* Open a new participation for a person.
*/