Fix serialization of accompangying period work referrers

This commit is contained in:
2023-11-14 18:34:28 +01:00
parent 1b0a30baf8
commit 88469dbe8e
2 changed files with 11 additions and 2 deletions

View File

@@ -392,9 +392,13 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
*/
public function getReferrers(): ReadableCollection
{
return $this->referrersHistory
$users = $this->referrersHistory
->filter(fn (AccompanyingPeriodWorkReferrerHistory $h) => null === $h->getEndDate())
->map(fn (AccompanyingPeriodWorkReferrerHistory $h) => $h->getUser());
->map(fn (AccompanyingPeriodWorkReferrerHistory $h) => $h->getUser())
->getValues()
;
return new ArrayCollection(array_values($users));
}
public function getReferrersHistory(): Collection