X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/c812e773a8195a42a718ce2de0a4e9bca65382aa..d8950f7e2adfbca7f28c64f4e0637e00359f9539:/Entity/Dance.php?ds=sidebyside diff --git a/Entity/Dance.php b/Entity/Dance.php index 59896cd..796b81f 100644 --- a/Entity/Dance.php +++ b/Entity/Dance.php @@ -210,7 +210,7 @@ class Dance { */ public function addUser(User $user): Dance { //Add from owning side - $user->addSubscriber($this); + $user->addDance($this); $this->users[] = $user; @@ -225,8 +225,12 @@ class Dance { * @return bool */ public function removeUser(User $user): bool { + if (!$this->dances->contains($user)) { + return true; + } + //Remove from owning side - $user->removeSubscriber($this); + $user->removeDance($this); return $this->users->removeElement($user); }