Total Complexity | 3 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | abstract class Model |
||
8 | { |
||
9 | /** @var int|null */ |
||
10 | public $id; |
||
11 | |||
12 | abstract public function validate(); |
||
13 | |||
14 | /** @return boolean */ |
||
15 | public function exists() |
||
16 | { |
||
17 | return isset($this->id); |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * Retorna o model ou define página 404 |
||
22 | * @return static |
||
23 | */ |
||
24 | public function or404() |
||
31 | } |
||
32 | } |
||
33 |