3 namespace Doctrine\Tests\Models\CustomType;
7 * @Table(name="customtype_parents")
12 * @Id @Column(type="integer")
13 * @GeneratedValue(strategy="AUTO")
18 * @Column(type="negative_to_positive", nullable=true)
20 public $customInteger;
23 * @OneToOne(targetEntity="Doctrine\Tests\Models\CustomType\CustomTypeChild", cascade={"persist", "remove"})
28 * @ManyToMany(targetEntity="Doctrine\Tests\Models\CustomType\CustomTypeParent", mappedBy="myFriends")
30 private $friendsWithMe;
33 * @ManyToMany(targetEntity="Doctrine\Tests\Models\CustomType\CustomTypeParent", inversedBy="friendsWithMe")
35 * name="customtype_parent_friends",
36 * joinColumns={@JoinColumn(name="customtypeparent_id", referencedColumnName="id")},
37 * inverseJoinColumns={@JoinColumn(name="friend_customtypeparent_id", referencedColumnName="id")}
42 public function __construct()
44 $this->friendsWithMe = new \Doctrine\Common\Collections\ArrayCollection();
45 $this->myFriends = new \Doctrine\Common\Collections\ArrayCollection();
48 public function addMyFriend(CustomTypeParent $friend)
50 $this->getMyFriends()->add($friend);
51 $friend->addFriendWithMe($this);
54 public function getMyFriends()
56 return $this->myFriends;
59 public function addFriendWithMe(CustomTypeParent $friend)
61 $this->getFriendsWithMe()->add($friend);
64 public function getFriendsWithMe()
66 return $this->friendsWithMe;