<?php

namespace App\Model\Entities\Components\Navigation;

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


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

    /**
     * @return Forum
     */
    public function getForum() : Forum
    {
        return $this->forum;
    }

    /**
     * @param Forum $forum
     */
    public function setForum(Forum $forum)
    {
        $this->forum = $forum;
    }

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

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

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