HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers95/rentman.io/app/Komma/Kms/SidebarListItem.php
<?php

/**
 * @copyright   (c) 2012-2016, Komma
 */

namespace App\Komma\Kms;

use App\Komma\Kms\Core\Entities\HasSearchableAttributesForSidebarInterface;
use Roumen\Sitemap\Model;

class SidebarListItem
{
    private $id;

    private $name;

    private $thumbnail;

    private $status;

    private $url;

    private $children;

    /** @var Model|HasSearchableAttributesForSidebarInterface */
    private $modelToAlsoSearchTrough;

    public function getId()
    {
        return $this->id;
    }

    public function setId($id)
    {
        $this->id = $id;
    }

    public function getName()
    {
        return $this->name;
    }

    public function setName($name)
    {
        $this->name = $name;
    }

    public function getThumbnail()
    {
        return $this->thumbnail;
    }

    public function setThumbnail($thumbnail)
    {
        $this->thumbnail = $thumbnail;
    }

    public function getStatus()
    {
        return $this->status;
    }

    public function setStatus($status)
    {
        $this->status = $status;
    }

    public function getUrl()
    {
        return $this->url;
    }

    public function setUrl($url)
    {
        $this->url = $url;
    }

    public function getChildren()
    {
        return $this->children;
    }

    /**
     * Returns some of the models attributes as json. Used for searching trough in the sidebar
     *
     * @return string
     */
    public function getModelToSearchTroughAsJson()
    {
        if (is_a($this->modelToAlsoSearchTrough, HasSearchableAttributesForSidebarInterface::class)) {
            return json_encode($this->modelToAlsoSearchTrough->searchableAttributesForSidebar());
        } else {
            return '{}';
        }
    }

    /**
     * The model you also want to search trough.
     * Only when it implements the HasSearchableAttributesForSidebarInterface it will be searched trough
     *
     * @param $model
     */
    public function alsoSearchInAttributesOfModel($model)
    {
        $this->modelToAlsoSearchTrough = $model;
    }
}