<?php

namespace App\Model\Entities\Components\Discussion;

use App\Model\Entities\Components\Messenger;
use App\Model\Entities\Templates\DiscussionTemplate;
use App\Model\Interfaces\IResource;
use App\Model\Interfaces\ITemplate;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 */
class Discussion extends Messenger implements IResource
{
    /**
     * @var DiscussionTemplate
     * @ORM\ManyToOne(targetEntity="App\Model\Entities\Templates\DiscussionTemplate")
     */
    protected $template;

    /**
     * @return DiscussionTemplate
     */
    public function getTemplate()
    {
        return $this->template;
    }

    /**
     * @param DiscussionTemplate $template
     */
    public function setTemplate(DiscussionTemplate $template)
    {
        $this->template = $template;
    }

    public function getResourceTemplate() : ITemplate
    {
        return $this->getTemplate();
    }
}