<?php

namespace AppBundle\Entity;

use Symfony\Component\Validator\Constraints as Assert;

class Room
{
    // von BookingRequest abgeguckt, brauch ich das überhaupt, wenn ich bei $type ein Assert habe?
    const SINGLE = 1;
    const DOUBLE = 2;
    const TRIPLE = 3;

    /**
     * @Assert\NotNull
     * @Assert\Choice(choices={1,2,3})
     */
    private $type;

    /**
     * @Assert\Valid
     */
    private $travelers = [];

    private $travelerCount;

    public function __construct($type)
    {
        $this->type = $type;
        for($i = 0; $i < $this->type; $i++)
        {
            $this->travelers[] = new Traveler();
        }

        $this->travelerCount = $type;
    }

    /**
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * @param int $type
     */
    public function setType($type)
    {
        $this->type = $type;
    }

    /**
     * @return Traveler[]
     */
    public function getTravelers()
    {
        return $this->travelers;
    }

    /**
     * @param Traveler[] $travelers
     */
    public function setTravelers($travelers)
    {
        $this->travelers = $travelers;
    }

    /**
     * @return mixed
     */
    public function getTravelerCount()
    {
        return $this->travelerCount;
    }

    /**
     * @param mixed $travelerCount
     */
    public function setTravelerCount($travelerCount)
    {
        $this->travelerCount = $travelerCount;
    }


}