<?php

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * TravelDiscount
 *
 * @ORM\Table(name="travel_discount", indexes={@ORM\Index(name="FK_discount_travel_period", columns={"period_id"})})
 * @ORM\Entity
 */
class TravelDiscount
{
    /**
     * @var float
     *
     * @ORM\Column(name="value", type="float", precision=10, scale=2, nullable=true)
     */
    private $value;

    /**
     * @var boolean
     *
     * @ORM\Column(name="percent", type="boolean", nullable=true)
     */
    private $percent = '0';

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="start", type="date", nullable=true)
     */
    private $start;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="end", type="date", nullable=true)
     */
    private $end;

    /**
     * @var boolean
     *
     * @ORM\Column(name="priority", type="boolean", nullable=true)
     */
    private $priority = '0';

    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var \AppBundle\Entity\TravelPeriod
     *
     * @ORM\ManyToOne(targetEntity="AppBundle\Entity\TravelPeriod", inversedBy="discounts")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="period_id", referencedColumnName="id")
     * })
     */
    private $period;



    /**
     * Set value
     *
     * @param float $value
     *
     * @return TravelDiscount
     */
    public function setValue($value)
    {
        $this->value = $value;

        return $this;
    }

    /**
     * Get value
     *
     * @return float
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
     * Set percent
     *
     * @param boolean $percent
     *
     * @return TravelDiscount
     */
    public function setPercent($percent)
    {
        $this->percent = $percent;

        return $this;
    }

    /**
     * Get percent
     *
     * @return boolean
     */
    public function getPercent()
    {
        return $this->percent;
    }

    /**
     * Set start
     *
     * @param \DateTime $start
     *
     * @return TravelDiscount
     */
    public function setStart($start)
    {
        $this->start = $start;

        return $this;
    }

    /**
     * Get start
     *
     * @return \DateTime
     */
    public function getStart()
    {
        return $this->start;
    }

    /**
     * Set end
     *
     * @param \DateTime $end
     *
     * @return TravelDiscount
     */
    public function setEnd($end)
    {
        $this->end = $end;

        return $this;
    }

    /**
     * Get end
     *
     * @return \DateTime
     */
    public function getEnd()
    {
        return $this->end;
    }

    /**
     * Set priority
     *
     * @param boolean $priority
     *
     * @return TravelDiscount
     */
    public function setPriority($priority)
    {
        $this->priority = $priority;

        return $this;
    }

    /**
     * Get priority
     *
     * @return boolean
     */
    public function getPriority()
    {
        return $this->priority;
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set period
     *
     * @param \AppBundle\Entity\TravelPeriod $period
     *
     * @return TravelDiscount
     */
    public function setPeriod(\AppBundle\Entity\TravelPeriod $period = null)
    {
        $this->period = $period;

        return $this;
    }

    /**
     * Get period
     *
     * @return \AppBundle\Entity\TravelPeriod
     */
    public function getPeriod()
    {
        return $this->period;
    }
}
