From 3bb7706790b4f955cfbc412ee65c4a620c15d5b0 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Rapha=C3=ABl=20Gertz?= <git@rapsys.eu>
Date: Tue, 27 Feb 2024 16:30:03 +0100
Subject: [PATCH] Fix location user add/remove from inverse side

---
 Entity/Location.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Entity/Location.php b/Entity/Location.php
index 613e462..73b07f7 100644
--- a/Entity/Location.php
+++ b/Entity/Location.php
@@ -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);
 	}
-- 
2.41.3