X-Git-Url: https://git.rapsys.eu/airbundle/blobdiff_plain/6235f8f993d9a97f08d00ce578c86da020d7e978..8f802c1a7fcaf4efe6822ecee3e19f1cededf2c4:/Entity/Dance.php diff --git a/Entity/Dance.php b/Entity/Dance.php index 8d83062..0b132c8 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,12 +225,12 @@ class Dance { * @return bool */ public function removeUser(User $user): bool { - if (!$this->users->contains($user)) { + if (!$this->dances->contains($user)) { return true; } //Remove from owning side - $user->removeSubscriber($this); + $user->removeDance($this); return $this->users->removeElement($user); } @@ -249,7 +249,7 @@ class Dance { */ public function preUpdate(PreUpdateEventArgs $eventArgs) { //Check that we have a dance instance - if (($dance = $eventArgs->getEntity()) instanceof Dance) { + if (($dance = $eventArgs->getObject()) instanceof Dance) { //Set updated value $dance->setUpdated(new \DateTime('now')); }