| Total Complexity | 5 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | trait Model |
||
| 21 | { |
||
| 22 | /** |
||
| 23 | * Gets the result set |
||
| 24 | * @inheritDoc |
||
| 25 | */ |
||
| 26 | public function get(?int $returnType = self::TYPE_ARRAY) |
||
|
|
|||
| 27 | { |
||
| 28 | return ($returnType == self::TYPE_OBJECT) ? $this->ormObject->find_many() : $this->ormObject->find_array(); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Creates new db record |
||
| 33 | * @inheritDoc |
||
| 34 | */ |
||
| 35 | public function create(): object |
||
| 36 | { |
||
| 37 | return $this->ormObject->create(); |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Saves the data into the database |
||
| 42 | * @inheritDoc |
||
| 43 | */ |
||
| 44 | public function save(): bool |
||
| 45 | { |
||
| 46 | return $this->ormObject->save(); |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Deletes the record from the database |
||
| 51 | * @inheritDoc |
||
| 52 | */ |
||
| 53 | public function delete(): bool |
||
| 56 | } |
||
| 57 | |||
| 58 | } |