name = $name; return $this; } /** * Get name * * @return string */ public function getName() { return $this->name; } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set travelCountry * * @param \AppBundle\Entity\TravelCountry $travelCountry * * @return TravelArrivalPoint */ public function setTravelCountry(\AppBundle\Entity\TravelCountry $travelCountry = null) { $this->travelCountry = $travelCountry; return $this; } /** * Get travelCountry * * @return \AppBundle\Entity\TravelCountry */ public function getTravelCountry() { return $this->travelCountry; } /** * Constructor */ public function __construct() { $this->departures = new \Doctrine\Common\Collections\ArrayCollection(); } /** * Add departure * * @param \AppBundle\Entity\TravelDeparturePoint $departure * * @return TravelArrivalPoint */ public final function addDeparture(\AppBundle\Entity\TravelDeparturePoint $departure) { if (!$this->__areDeparturesInitialized__ && isset($this->__initializer__)) { // Imitate proxy behavior, because this method is final and therefore ignored by the proxy $this->__initializer__->__invoke($this, 'addDeparture', [$departure]); } $this->departures[] = $departure; return $this; } public $__initializer__; public $__areDeparturesInitialized__ = false; /** * Set departures, because the travel date search algorithm already retrieves them at another place. Therefore * the proxy must be prevented from loading the entire entity as soon as the manually attached departures are * accessed. To achieve the prevention, the accessor methods are "final". They imitate the proxy's behavior, in * case they are called and departures haven't been set manually before. * * @param ArrayCollection $departures * * @internal */ public final function __setDepartures($departures) { $this->__areDeparturesInitialized__ = true; if ($departures === null) { $this->departures = null; } $this->departures = new ArrayCollection(); foreach ($departures as $departure) { $this->departures->add($departure); } } /** * Remove departure * * @param \AppBundle\Entity\TravelDeparturePoint $departure */ public final function removeDeparture(\AppBundle\Entity\TravelDeparturePoint $departure) { if (!$this->__areDeparturesInitialized__ && isset($this->__initializer__)) { // Imitate proxy behavior, because this method is final and therefore ignored by the proxy $this->__initializer__->__invoke($this, 'removeDeparture', [$departure]); } $this->departures->removeElement($departure); } /** * Get departures * * @return \Doctrine\Common\Collections\Collection|TravelDeparturePoint[] */ public final function getDepartures() { if (!$this->__areDeparturesInitialized__ && isset($this->__initializer__)) { // Imitate proxy behavior, because this method is final and therefore ignored by the proxy $this->__initializer__->__invoke($this, 'getDeparture', []); } return $this->departures; } }