File: D:/HostingSpaces/SBogers104/angeliekly.nl/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);
}
}