| 1 | <?php |
||
| 12 | class Scope extends AbstractEntity |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | protected $name; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var bool |
||
| 21 | */ |
||
| 22 | protected $defaultScope = false; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * {@inheritdoc} |
||
| 26 | * |
||
| 27 | * @param string $name |
||
| 28 | * @param bool $default |
||
| 29 | */ |
||
| 30 | public function __construct($uuid = null, $name = null, $default = null) |
||
| 31 | { |
||
| 32 | parent::__construct($uuid); |
||
| 33 | |||
| 34 | if ($name) { |
||
| 35 | $this->setName($name); |
||
| 36 | } |
||
| 37 | |||
| 38 | if ($default) { |
||
| 39 | $this->setDefaultScope($default); |
||
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return string |
||
| 45 | */ |
||
| 46 | public function getName() |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @param string $name |
||
| 53 | */ |
||
| 54 | public function setName($name) |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return bool |
||
| 61 | */ |
||
| 62 | public function isDefaultScope() |
||
| 63 | { |
||
| 64 | return $this->defaultScope; |
||
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @param bool $default |
||
| 69 | */ |
||
| 70 | public function setDefaultScope($default) |
||
| 71 | { |
||
| 72 | $this->defaultScope = (bool) $default; |
||
| 73 | } |
||
| 74 | |||
| 75 | /** |
||
| 76 | * @return string |
||
| 77 | */ |
||
| 78 | public function __toString() |
||
| 82 | } |
||
| 83 |