X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/60e532d5368faa6cbb048d61cac5695c0b972782..8f802c1a7fcaf4efe6822ecee3e19f1cededf2c4:/Entity/Location.php diff --git a/Entity/Location.php b/Entity/Location.php index 613e462..85283df 100644 --- a/Entity/Location.php +++ b/Entity/Location.php @@ -430,7 +430,7 @@ class Location { */ public function addUser(User $user): Location { //Add from owning side - $user->addSubscriber($this); + $user->addLocation($this); $this->users[] = $user; @@ -444,12 +444,12 @@ class Location { * @return bool */ public function removeUser(User $user): bool { - if (!$this->users->contains($user)) { + if (!$this->locations->contains($user)) { return true; } //Remove from owning side - $user->removeSubscriber($this); + $user->removeLocation($this); return $this->users->removeElement($user); } @@ -468,7 +468,7 @@ class Location { */ public function preUpdate(PreUpdateEventArgs $eventArgs) { //Check that we have a location instance - if (($location = $eventArgs->getEntity()) instanceof Location) { + if (($location = $eventArgs->getObject()) instanceof Location) { //Set updated value $location->setUpdated(new \DateTime('now')); }