Fixed: use CenterResolver where cases when center is resolved differently

This commit is contained in:
2022-07-12 11:10:18 +02:00
parent 11d1b26efc
commit 5896a77ae9
2 changed files with 12 additions and 5 deletions

View File

@@ -306,14 +306,14 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
* get the center
* center is extracted from person.
*/
public function getCenters(): array
public function getCenters(): iterable
{
if ($this->person instanceof Person) {
return [$this->person->getCenter()];
}
if ($this->getAccompanyingPeriod() instanceof AccompanyingPeriod) {
return $this->getAccompanyingPeriod()->getCenters();
return $this->getAccompanyingPeriod()->getCenters() ?? [];
}
return [];