Replace ArrayCollection with Collection&Selectable on some entity typing (fix previous commit)

Updated entity properties to use Collection&Selectable for better type safety and interoperability. This change affects User, Household, Calendar, Person, AccompanyingPeriod, and EntityWorkflow classes.
This commit is contained in:
2024-08-28 12:04:43 +02:00
parent c16219dc6d
commit b0485dbcc8
6 changed files with 22 additions and 19 deletions

View File

@@ -39,6 +39,7 @@ use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria;
use Doctrine\Common\Collections\Selectable;
use Doctrine\ORM\Mapping as ORM;
use libphonenumber\PhoneNumber;
use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
@@ -153,10 +154,10 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
private ?PersonCenterCurrent $centerCurrent = null;
/**
* @var ArrayCollection<int, PersonCenterHistory>
* @var \Doctrine\Common\Collections\Collection<int, \Chill\PersonBundle\Entity\Person\PersonCenterHistory>&Selectable
*/
#[ORM\OneToMany(mappedBy: 'person', targetEntity: PersonCenterHistory::class, cascade: ['persist', 'remove'])]
private ArrayCollection $centerHistory;
private Collection&Selectable $centerHistory;
/**
* Array where customfield's data are stored.
@@ -1440,7 +1441,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this;
}
public function setCenterHistory(Collection $centerHistory): Person
public function setCenterHistory(Collection&Selectable $centerHistory): Person
{
$this->centerHistory = $centerHistory;