<?php

namespace App\Model\Entities\Components\Navigation;

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

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

    /**
     * @return Gallery
     */
    public function getGallery() : Gallery
    {
        return $this->gallery;
    }

    /**
     * @param Gallery $gallery
     */
    public function setGallery(Gallery $gallery)
    {
        $this->gallery = $gallery;
    }

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

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

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