<?php

namespace App\Model\Entities\Components\News;

use App\Model\Entities\BaseNamedRecord;
use App\Model\Entities\Templates\NewsTemplate;
use App\Model\Interfaces\ICommonRecord;
use App\Model\Interfaces\IResource;
use App\Model\Interfaces\ITemplate;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="news_container")
 */
class NewsContainer extends BaseNamedRecord implements ICommonRecord, IResource
{

    /**
     * @var NewsTemplate;
     * @ORM\ManyToOne(targetEntity="App\Model\Entities\Templates\NewsTemplate")
     */
    protected $template;


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

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

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