1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?php
-
- namespace Doctrine\Tests\Models\Company;
-
-
- class CompanyPerson
- {
-
-
- private $id;
-
-
- private $name;
-
-
- private $spouse;
-
-
-
- private $friends;
-
- public function __construct() {
- $this->friends = new \Doctrine\Common\Collections\ArrayCollection;
- }
-
- public function getId() {
- return $this->id;
- }
-
- public function getName() {
- return $this->name;
- }
-
- public function setName($name) {
- $this->name = $name;
- }
-
- public function getSpouse() {
- return $this->spouse;
- }
-
- public function getFriends() {
- return $this->friends;
- }
-
- public function addFriend(CompanyPerson $friend) {
- if ( ! $this->friends->contains($friend)) {
- $this->friends->add($friend);
- $friend->addFriend($this);
- }
- }
-
- public function setSpouse(CompanyPerson $spouse) {
- if ($spouse !== $this->spouse) {
- $this->spouse = $spouse;
- $this->spouse->setSpouse($this);
- }
- }
- }
-
|