for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace flipbox\saml\core\records\traits;
use yii\base\Model;
/**
* Trait Ember
* @package flipbox\saml\core\records
* @property bool $enabled
*/
trait Ember
{
* {@inheritdoc}
public static function tableAlias()
return static::TABLE_ALIAS;
}
public static function tableName()
return '{{%' . static::tableAlias() . '}}';
* @inheritdoc
public function stateRules()
return [
[
'enabled'
],
'safe',
'on' => [
Model::SCENARIO_DEFAULT
]
];
public function isEnabled()
return (bool)$this->enabled;
public function isDisabled()
return !$this->isEnabled();
public function toEnabled()
$this->enabled = true;
return $this;
public function toDisabled()
$this->enabled = false;