| Total Complexity | 6 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class DomainModel extends Model |
||
| 15 | { |
||
| 16 | private string $name; |
||
| 17 | |||
| 18 | 1 | public function __construct() |
|
| 19 | { |
||
| 20 | 1 | $this->setTable(_DOMAIN::table()); |
|
| 21 | 1 | $this->setKeyName(_DOMAIN::ID->column()); |
|
| 22 | } |
||
| 23 | |||
| 24 | 1 | public function getName(): string |
|
| 25 | { |
||
| 26 | 1 | return $this->name; |
|
| 27 | } |
||
| 28 | |||
| 29 | 1 | public function setName($name) : self |
|
| 30 | { |
||
| 31 | 1 | $this->name = $name; |
|
| 32 | 1 | return $this; |
|
| 33 | } |
||
| 34 | |||
| 35 | 1 | public function create() : int |
|
| 36 | { |
||
| 37 | 1 | return $this->insert([ |
|
| 38 | 1 | _DOMAIN::NAME->column() => $this->getName() |
|
| 39 | 1 | ]); |
|
| 40 | } |
||
| 41 | |||
| 42 | 1 | public function toArray(): array |
|
| 48 | } |
||
| 49 | |||
| 50 | |||
| 51 | } |