traveler = $traveler; $this->createdAt = new \DateTime('now'); $this->visitedCities = new ArrayCollection(); } /** * @return integer */ public function getId() { return $this->id; } /** * @return \Doctrine\Tests\Models\Cache\Traveler */ public function getTraveler() { return $this->traveler; } /** * @param \Doctrine\Tests\Models\Cache\Traveler $traveler */ public function setTraveler(Traveler $traveler) { $this->traveler = $traveler; } /** * @return \Doctrine\Common\Collections\ArrayCollection */ public function getVisitedCities() { return $this->visitedCities; } /** * @param \Doctrine\Tests\Models\Cache\City $city */ public function addVisitedCity(City $city) { $this->visitedCities->add($city); } /** * @param \Doctrine\Tests\Models\Cache\City $city */ public function removeVisitedCity(City $city) { $this->visitedCities->removeElement($city); } /** * @return \DateTime */ public function getCreatedAt() { return $this->createdAt; } }