<?php

namespace App\Model\Entities\Components\Navigation;

use App\Model\Entities\BaseEntity;
use App\Model\Entities\Interfaces\INavItem;
use App\Model\Entities\PortalSite;
use App\Model\Interfaces\ISite;
use Doctrine\ORM\Mapping as ORM;


/**
 * @ORM\Entity
 * @ORM\Table(name="nav_item")
 * @ORM\InheritanceType(value="SINGLE_TABLE")
 */
abstract class BaseNavItem extends BaseEntity implements INavItem
{
    /**
     * @ORM\Column(type="string")
     */
    protected $label;

    /**
     * @ORM\Column(type="string")
     */
    protected $icon;

    /**
     * @ORM\Column(type="integer")
     */
    protected $itemOrder;

    /**
     * @ORM\Column(type="boolean")
     */
    protected $isHomepage;

    /**
     * @var ISite
     * @ORM\ManyToOne(targetEntity="App\Model\Entities\PortalSite")
     */
    protected $site;

    public function __construct()
    {
        $this->setIsHomepage(false);
    }

    /**
     * @return string
     */
    public function getLabel() : string
    {
        return $this->label;
    }

    /**
     * @param string $label
     */
    public function setLabel(string $label)
    {
        $this->label = $label;
    }

    /**
     * @return string
     */
    public function getIcon() : string
    {
        return $this->icon;
    }

    /**
     * @param string $icon
     */
    public function setIcon(string $icon)
    {
        $this->icon = $icon;
    }

    /**
     * @return int
     */
    public function getItemOrder() : int
    {
        return $this->itemOrder;
    }

    /**
     * @param int $itemOrder
     */
    public function setItemOrder(int $itemOrder)
    {
        $this->itemOrder = $itemOrder;
    }

    /**
     * @return bool
     */
    public function isHomepage() : bool
    {
        return $this->isHomepage;
    }

    /**
     * @param bool $isHomepage
     */
    public function setIsHomepage(bool $isHomepage)
    {
        $this->isHomepage = $isHomepage;
    }

    /**
     * @return ISite
     */
    public function getSite() : ISite
    {
        return $this->site;
    }

    /**
     * @param ISite $site
     */
    public function setSite(ISite $site)
    {
        $this->site = $site;
    }
}