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/SBogers10/umans.komma.pro/workbench/komma/kms/src/Komma/Kms/Blocks/BlockEntity.php
<?php

/**
 * @author      Komma <support@komma.pro>
 * @copyright   (c) 2012-2016, Komma Mediadesign
 */

namespace Komma\Kms\Blocks;

use Komma\Kms\Blocks\Models\Block;
use Komma\Kms\Core\Entities\KmsTranslatableEntity;
use Komma\Kms\Core\Kms;

class BlockEntity extends KmsTranslatableEntity
{
    public $id = null;
    public $active = 1;
    public $code_name = '';
    public $navigation_label = '';
    public $view = '';
    public $type = '';
    public $link = null;

    public function __construct($data, $id =null){
        parent::__construct($data, $id);
    }

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

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

    public function getName()
    {
        //Get the english name as sidebar title en section title
        $defaultTrans =  Block::where('id', '=', $this->id)->first();
        if(isset($defaultTrans) && $defaultTrans->navigation_label != '') return $defaultTrans->navigation_label;

        //Return a cleaned name for the sidebar
        return helper_underscore_to_space($this->code_name);
    }
}