]> Raphaƫl G. Git Repositories - airbundle/blobdiff - Entity/Location.php
Act on owning side
[airbundle] / Entity / Location.php
index c379b560c8a614805d013845a31359e58553fb9b..984e8d86449593b160334a94560d2ddfd34211c3 100644 (file)
@@ -429,6 +429,9 @@ class Location {
         * @return Location
         */
        public function addUser(User $user): Location {
+               //Add from owning side
+               $user->addSubscriber($this);
+
                $this->users[] = $user;
 
                return $this;
@@ -441,6 +444,9 @@ class Location {
         * @return bool
         */
        public function removeUser(User $user): bool {
+               //Remove from owning side
+               $user->removeSubscriber($this);
+
                return $this->users->removeElement($user);
        }