206 lines
4.1 KiB
PHP
206 lines
4.1 KiB
PHP
<?php
|
|
|
|
namespace AppBundle\Entity;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
/**
|
|
* FlightPeriod
|
|
*
|
|
* @ORM\Table(name="flight_period", uniqueConstraints={@ORM\UniqueConstraint(name="UK_start_date_end_date_travel_arrival_point", columns={"start_date", "end_date", "travel_arrival_point_id"})}, indexes={@ORM\Index(name="FK_flight_period_travel_arrival_point", columns={"travel_arrival_point_id"})})
|
|
* @ORM\Entity(repositoryClass="AppBundle\Entity\FlightPeriodRepository")
|
|
*/
|
|
class FlightPeriod
|
|
{
|
|
/**
|
|
* @var \DateTime
|
|
*
|
|
* @ORM\Column(name="start_date", type="date", nullable=true)
|
|
*/
|
|
private $startDate;
|
|
|
|
/**
|
|
* @var \DateTime
|
|
*
|
|
* @ORM\Column(name="end_date", type="date", nullable=true)
|
|
*/
|
|
private $endDate;
|
|
|
|
/**
|
|
* @var float
|
|
*
|
|
* @ORM\Column(name="price", type="float", precision=10, scale=2, nullable=true)
|
|
*/
|
|
private $price;
|
|
|
|
/**
|
|
* @var integer
|
|
*
|
|
* @ORM\Column(name="id", type="integer")
|
|
* @ORM\Id
|
|
* @ORM\GeneratedValue(strategy="IDENTITY")
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* @var \AppBundle\Entity\TravelArrivalPoint
|
|
*
|
|
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\TravelArrivalPoint")
|
|
* @ORM\JoinColumns({
|
|
* @ORM\JoinColumn(name="travel_arrival_point_id", referencedColumnName="id")
|
|
* })
|
|
*/
|
|
private $travelArrivalPoint;
|
|
|
|
/**
|
|
* @ORM\OneToMany(targetEntity="AppBundle\Entity\TravelDeparturePoint", mappedBy="flightPeriod")
|
|
*/
|
|
private $departures;
|
|
|
|
/**
|
|
* Set startDate
|
|
*
|
|
* @param \DateTime $startDate
|
|
*
|
|
* @return FlightPeriod
|
|
*/
|
|
public function setStartDate($startDate)
|
|
{
|
|
$this->startDate = $startDate;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get startDate
|
|
*
|
|
* @return \DateTime
|
|
*/
|
|
public function getStartDate()
|
|
{
|
|
return $this->startDate;
|
|
}
|
|
|
|
/**
|
|
* Set endDate
|
|
*
|
|
* @param \DateTime $endDate
|
|
*
|
|
* @return FlightPeriod
|
|
*/
|
|
public function setEndDate($endDate)
|
|
{
|
|
$this->endDate = $endDate;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get endDate
|
|
*
|
|
* @return \DateTime
|
|
*/
|
|
public function getEndDate()
|
|
{
|
|
return $this->endDate;
|
|
}
|
|
|
|
/**
|
|
* Set price
|
|
*
|
|
* @param float $price
|
|
*
|
|
* @return FlightPeriod
|
|
*/
|
|
public function setPrice($price)
|
|
{
|
|
$this->price = $price;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get price
|
|
*
|
|
* @return float
|
|
*/
|
|
public function getPrice()
|
|
{
|
|
return $this->price;
|
|
}
|
|
|
|
/**
|
|
* Get id
|
|
*
|
|
* @return integer
|
|
*/
|
|
public function getId()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
/**
|
|
* Set travelArrivalPoint
|
|
*
|
|
* @param \AppBundle\Entity\TravelArrivalPoint $travelArrivalPoint
|
|
*
|
|
* @return FlightPeriod
|
|
*/
|
|
public function setTravelArrivalPoint(\AppBundle\Entity\TravelArrivalPoint $travelArrivalPoint = null)
|
|
{
|
|
$this->travelArrivalPoint = $travelArrivalPoint;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get travelArrivalPoint
|
|
*
|
|
* @return \AppBundle\Entity\TravelArrivalPoint
|
|
*/
|
|
public function getTravelArrivalPoint()
|
|
{
|
|
return $this->travelArrivalPoint;
|
|
}
|
|
/**
|
|
* Constructor
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->departures = new \Doctrine\Common\Collections\ArrayCollection();
|
|
}
|
|
|
|
/**
|
|
* Add departure
|
|
*
|
|
* @param \AppBundle\Entity\TravelDeparturePoint $departure
|
|
*
|
|
* @return FlightPeriod
|
|
*/
|
|
public function addDeparture(\AppBundle\Entity\TravelDeparturePoint $departure)
|
|
{
|
|
$this->departures[] = $departure;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Remove departure
|
|
*
|
|
* @param \AppBundle\Entity\TravelDeparturePoint $departure
|
|
*/
|
|
public function removeDeparture(\AppBundle\Entity\TravelDeparturePoint $departure)
|
|
{
|
|
$this->departures->removeElement($departure);
|
|
}
|
|
|
|
/**
|
|
* Get departures
|
|
*
|
|
* @return \Doctrine\Common\Collections\Collection
|
|
*/
|
|
public function getDepartures()
|
|
{
|
|
return $this->departures;
|
|
}
|
|
}
|