| 1 | <?php |
||
| 13 | class State |
||
| 14 | { |
||
| 15 | private $status = [ |
||
| 16 | 'empty' => false, |
||
| 17 | 'loaded' => false, |
||
| 18 | 'dirty' => false, |
||
| 19 | 'deleting' => false, |
||
| 20 | 'deleted' => false, |
||
| 21 | 'new' => false, |
||
| 22 | ]; |
||
| 23 | |||
| 24 | public function __construct() |
||
| 28 | |||
| 29 | public function is($status) |
||
| 33 | |||
| 34 | public function setDeleted($bit = true) |
||
| 42 | |||
| 43 | public function setDeleting($bit = true) |
||
| 47 | |||
| 48 | public function setNew($bit = true) |
||
| 53 | |||
| 54 | public function setLoaded($bit = true) |
||
| 59 | |||
| 60 | public function setDirty($bit = true) |
||
| 64 | |||
| 65 | public function setEmpty($bit = true) |
||
| 69 | |||
| 70 | protected function set($key, $bit) |
||
| 74 | } |
||
| 75 |