]> Raphaƫl G. Git Repositories - airbundle/blobdiff - Entity/Location.php
Shorten air bundle route aliases
[airbundle] / Entity / Location.php
index 613e46281c3664f841ddbc86f8790c8bfb50f966..85283df046b4db3323b5396b9d86d07c4eafa922 100644 (file)
@@ -430,7 +430,7 @@ class Location {
         */
        public function addUser(User $user): Location {
                //Add from owning side
         */
        public function addUser(User $user): Location {
                //Add from owning side
-               $user->addSubscriber($this);
+               $user->addLocation($this);
 
                $this->users[] = $user;
 
 
                $this->users[] = $user;
 
@@ -444,12 +444,12 @@ class Location {
         * @return bool
         */
        public function removeUser(User $user): bool {
         * @return bool
         */
        public function removeUser(User $user): bool {
-               if (!$this->users->contains($user)) {
+               if (!$this->locations->contains($user)) {
                        return true;
                }
 
                //Remove from owning side
                        return true;
                }
 
                //Remove from owning side
-               $user->removeSubscriber($this);
+               $user->removeLocation($this);
 
                return $this->users->removeElement($user);
        }
 
                return $this->users->removeElement($user);
        }
@@ -468,7 +468,7 @@ class Location {
         */
        public function preUpdate(PreUpdateEventArgs $eventArgs) {
                //Check that we have a location instance
         */
        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'));
                }
                        //Set updated value
                        $location->setUpdated(new \DateTime('now'));
                }