<?php

namespace AppBundle\Entity;

use Symfony\Component\Validator\Constraints\Date;

use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;

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

    // es gab hier lodgings, wird aber über prices geholt

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=255, nullable=false)
     */
    private $name;

    /**
     * @var \AppBundle\Entity\FewoPrice
     *
     * @ORM\OneToMany(targetEntity="FewoPrice", mappedBy="season", cascade={"persist", "remove"})
     */
    private $prices;

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

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

    /**
     * @var integer
     *
     * @ORM\Column(name="minimum_stay", type="integer", nullable=false)
     */
    private $minimumStay;

    /**
     * @var string
     *
     * @ORM\Column(name="description", type="text", nullable=true)
     */
    private $description;

    /**
     * @var integer
     *
     * @ORM\Column(name="only_weekday", type="integer", nullable=true)
     */
    private $onlyWeekday;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->prices = new \Doctrine\Common\Collections\ArrayCollection();
    }

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

    /**
     * Set fromDate
     *
     * @param \DateTime $fromDate
     *
     * @return FewoSeason
     */
    public function setFromDate($fromDate)
    {
        $this->fromDate = $fromDate;

        return $this;
    }

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

    /**
     * Set toDate
     *
     * @param \DateTime $toDate
     *
     * @return FewoSeason
     */
    public function setToDate($toDate)
    {
        $this->toDate = $toDate;

        return $this;
    }

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

    /**
     * Set minimumStay
     *
     * @param integer $minimumStay
     *
     * @return FewoSeason
     */
    public function setMinimumStay($minimumStay)
    {
        $this->minimumStay = $minimumStay;

        return $this;
    }

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

    /**
     * Set description
     *
     * @param string $description
     *
     * @return FewoSeason
     */
    public function setDescription($description)
    {
        $this->description = $description;

        return $this;
    }

    /**
     * Get description
     *
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Add price
     *
     * @param \AppBundle\Entity\FewoPrice $price
     *
     * @return FewoSeason
     */
    public function addPrice(\AppBundle\Entity\FewoPrice $price)
    {
        $this->prices[] = $price;

        return $this;
    }

    /**
     * Remove price
     *
     * @param \AppBundle\Entity\FewoPrice $price
     */
    public function removePrice(\AppBundle\Entity\FewoPrice $price)
    {
        $this->prices->removeElement($price);
    }

    /**
     * Get prices
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getPrices()
    {
        return $this->prices;
    }

    /**
     * Set name
     *
     * @param string $name
     *
     * @return FewoSeason
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    function __toString()
    {
        return $this->name;
    }


    /**
     * Set onlyWeekday
     *
     * @param integer $onlyWeekday
     *
     * @return FewoSeason
     */
    public function setOnlyWeekday($onlyWeekday)
    {
        $this->onlyWeekday = $onlyWeekday;

        return $this;
    }

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