]> Raphaël G. Git Repositories - airbundle/commitdiff
Fix location user add/remove from inverse side
authorRaphaël Gertz <git@rapsys.eu>
Tue, 27 Feb 2024 15:30:03 +0000 (16:30 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Tue, 27 Feb 2024 15:30:03 +0000 (16:30 +0100)
Entity/Location.php

index 613e46281c3664f841ddbc86f8790c8bfb50f966..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,12 +444,12 @@ class Location {
         * @return bool
         */
        public function removeUser(User $user): bool {
-               if (!$this->users->contains($user)) {
+               if (!$this->locations->contains($user)) {
                        return true;
                }
 
                //Remove from owning side
-               $user->removeSubscriber($this);
+               $user->removeLocation($this);
 
                return $this->users->removeElement($user);
        }