<?php

namespace App\Model\Entities\Components\Pool;


use App\Model\Entities\BaseRecord;
use App\Model\Entities\Security\User;
use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="pool")
 */
class Pool extends BaseRecord
{
    /**
     * @ORM\Column(type="string")
     */
    protected $question;

    /**
     * @var ArrayCollection
     * @ORM\OneToMany(targetEntity="Answer", mappedBy="pool")
     */
    protected $answers;

    /**
     * @var DateTime
     * @ORM\Column(type="datetime", nullable=true)
     */
    protected $durationFrom;

    /**
     * @var DateTime
     * @ORM\Column(type="datetime", nullable=true)
     */
    protected $durationTo;

    public function __construct(User $createdBy)
    {
        parent::__construct($createdBy);

        $this->answers = new ArrayCollection();
    }

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

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

    /**
     * @return DateTime
     */
    public function getDurationFrom()
    {
        return $this->durationFrom;
    }

    /**
     * @param DateTime $durationFrom
     */
    public function setDurationFrom(DateTime $durationFrom)
    {
        $this->durationFrom = $durationFrom;
    }

    /**
     * @return DateTime
     */
    public function getDurationTo()
    {
        return $this->durationTo;
    }

    /**
     * @param DateTime $durationTo
     */
    public function setDurationTo(DateTime $durationTo)
    {
        $this->durationTo = $durationTo;
    }

    /**
     * @return ArrayCollection
     */
    public function getAnswers()
    {
        return $this->answers;
    }
}