name = $name; $this->travels = new ArrayCollection(); } public function getId() { return $this->id; } public function setId($id) { $this->id = $id; } public function getName() { return $this->name; } public function setName($name) { $this->name = $name; } public function getTravels() { return $this->travels; } /** * @param \Doctrine\Tests\Models\Cache\Travel $item */ public function addTravel(Travel $item) { if ( ! $this->travels->contains($item)) { $this->travels->add($item); } if ($item->getTraveler() !== $this) { $item->setTraveler($this); } } /** * @param \Doctrine\Tests\Models\Cache\Travel $item */ public function removeTravel(Travel $item) { $this->travels->removeElement($item); } }