<?php

namespace App\Model\Entities\Components\Navigation;

use App\Model\Entities\Components\Article\Article;
use App\Model\Interfaces\IResource;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 */
class NavItemArticle extends BaseNavItem
{
    /**
     * @var Article
     * @ORM\OneToOne(targetEntity="App\Model\Entities\Components\Article\Article")
     */
    protected $article;

    public function getLinkDestination() : string
    {
        return 'Article:';
    }

    public function getLinkParams() : array
    {
        return ['id' => $this->article->getId()];
    }

    public function getResource() : IResource
    {
        return $this->article;
    }
}