friendsWithMe = new \Doctrine\Common\Collections\ArrayCollection(); $this->myFriends = new \Doctrine\Common\Collections\ArrayCollection(); } public function addMyFriend(CustomTypeParent $friend) { $this->getMyFriends()->add($friend); $friend->addFriendWithMe($this); } public function getMyFriends() { return $this->myFriends; } public function addFriendWithMe(CustomTypeParent $friend) { $this->getFriendsWithMe()->add($friend); } public function getFriendsWithMe() { return $this->friendsWithMe; } }