Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
53 lines (43 sloc) 859 Bytes
<?php
namespace LaravelFeature\Domain\Model;
class Feature
{
private $name;
private $isEnabled;
public static function fromNameAndStatus($name, $isEnabled)
{
$feature = new self($name, (bool) $isEnabled);
return $feature;
}
private function __construct($name, $isEnabled)
{
$this->name = $name;
$this->isEnabled = $isEnabled;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @return bool
*/
public function isEnabled()
{
return $this->isEnabled;
}
public function setNewName($newName)
{
$this->name = $newName;
}
public function enable()
{
$this->isEnabled = true;
}
public function disable()
{
$this->isEnabled = false;
}
}