]> Raphaƫl G. Git Repositories - airbundle/blobdiff - Entity/Location.php
Set synchronized as not nullable
[airbundle] / Entity / Location.php
index 984e8d86449593b160334a94560d2ddfd34211c3..73b07f7c93d02183f9b6db768cab05c48ffea2b5 100644 (file)
@@ -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);
        }