X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/c812e773a8195a42a718ce2de0a4e9bca65382aa..5d61020df0a545c786a877ad73ccdf95799a81be:/Entity/Location.php?ds=sidebyside diff --git a/Entity/Location.php b/Entity/Location.php index 984e8d8..73b07f7 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,8 +444,12 @@ class Location { * @return bool */ public function removeUser(User $user): bool { + if (!$this->locations->contains($user)) { + return true; + } + //Remove from owning side - $user->removeSubscriber($this); + $user->removeLocation($this); return $this->users->removeElement($user); }