]> Raphaƫl G. Git Repositories - airbundle/blobdiff - Entity/Dance.php
Shorten air bundle route aliases
[airbundle] / Entity / Dance.php
index 8d83062901439c9a72b02a88da5c5f7da43f1b7b..0b132c8418cd76f59846514ffb62784aaa222743 100644 (file)
@@ -210,7 +210,7 @@ class Dance {
         */
        public function addUser(User $user): Dance {
                //Add from owning side
         */
        public function addUser(User $user): Dance {
                //Add from owning side
-               $user->addSubscriber($this);
+               $user->addDance($this);
 
                $this->users[] = $user;
 
 
                $this->users[] = $user;
 
@@ -225,12 +225,12 @@ class Dance {
         * @return bool
         */
        public function removeUser(User $user): bool {
         * @return bool
         */
        public function removeUser(User $user): bool {
-               if (!$this->users->contains($user)) {
+               if (!$this->dances->contains($user)) {
                        return true;
                }
 
                //Remove from owning side
                        return true;
                }
 
                //Remove from owning side
-               $user->removeSubscriber($this);
+               $user->removeDance($this);
 
                return $this->users->removeElement($user);
        }
 
                return $this->users->removeElement($user);
        }
@@ -249,7 +249,7 @@ class Dance {
         */
        public function preUpdate(PreUpdateEventArgs $eventArgs) {
                //Check that we have a dance instance
         */
        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'));
                }
                        //Set updated value
                        $dance->setUpdated(new \DateTime('now'));
                }