Total Complexity | 11 |
Total Lines | 76 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | class State extends Model |
||
11 | { |
||
12 | /** |
||
13 | * State constructor. |
||
14 | */ |
||
15 | public function __construct() |
||
16 | { |
||
17 | parent::__construct("state", ["id"], ["name", "acronym"]); |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * @param string $name |
||
22 | * @param string $acronym |
||
23 | * @return State |
||
24 | */ |
||
25 | public function bootstrap(string $name, string $acronym): State |
||
26 | { |
||
27 | $this->name = $name; |
||
|
|||
28 | $this->acronym = $acronym; |
||
29 | return $this; |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @param string $name |
||
34 | * @param string $columns |
||
35 | * @return null|State |
||
36 | */ |
||
37 | public function findByName(string $name, string $columns = "*"): ?State |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @return bool |
||
46 | */ |
||
47 | public function save(): bool |
||
88 |