* @return Location
*/
public function addUser(User $user): Location {
+ //Add from owning side
+ $user->addLocation($this);
+
$this->users[] = $user;
return $this;
* @return bool
*/
public function removeUser(User $user): bool {
+ if (!$this->locations->contains($user)) {
+ return true;
+ }
+
+ //Remove from owning side
+ $user->removeLocation($this);
+
return $this->users->removeElement($user);
}