Fix serialization of accompangying period work referrers

This commit is contained in:
Julien Fastré 2023-11-14 18:34:28 +01:00
parent 1b0a30baf8
commit 88469dbe8e
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,5 @@
kind: Fixed
body: 'Fix loading of accompanying period work referrers '
time: 2023-11-14T18:33:43.284236146+01:00
custom:
Issue: "205"

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