File: D:/HostingSpaces/SBogers10/meulendijk.komma.pro/app/KommaApp/Kms/Core/Attributes/KmsOnOff.php
<?php
/**
*
*
* @author Komma <info@komma.pro>
* @copyright (c) 2012-2016, Komma
*/
namespace App\KommaApp\Kms\Core\Attributes;
use View;
/**
* Class KmsOnOff
* @package App\KommaApp\Kms\Core\Attributes
*
* @deprecated Do not use this anymore. Use the new OnOff class
*/
class KmsOnOff extends KmsAttribute{
public $label;
public $placeholder;
function __construct($key, $value, array $options = [], array $errors = [], $siteId = null, $languageId = null, $section = null)
{
parent::__construct($key, $value, $options, $errors, $siteId, $languageId, $section);
$this->label = $this->getOption('label', $key);
$this->placeholder = $this->getOption('placeholder', $key);
$this->extra_info = $this->getOption('extra_info', '');
}
public function render()
{
return View::make('kms/attributes.onOff', [
'attribute' => $this
]);
}
public function getValue($post = false)
{
if(!isset($this->value)) return $this->default_value;
if($this->value == 1){
return 1;
}
return 0;
}
}