diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index ee8065662..56a2e4dcd 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -149,7 +149,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin * * @ORM\JoinTable(name="chill_3party.party_center") */ - private readonly Collection $centers; + private Collection $centers; /** * Contact Persons: One Institutional ThirdParty has Many Contact Persons. @@ -691,15 +691,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin */ public function setCenters(Collection $centers) { - foreach ($centers as $center) { - $this->addCenter($center); - } - - foreach ($this->centers as $center) { - if (false === $centers->contains($center)) { - $this->removeCenter($center); - } - } + $this->centers = $centers; return $this; }