| Total Complexity | 7 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | trait Getter |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * Get current model Id or UUID. |
||
| 23 | */ |
||
| 24 | public function getId(): mixed |
||
| 25 | { |
||
| 26 | return $this->__meta['id']; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Get current table name of model. |
||
| 31 | */ |
||
| 32 | public function getName(): string |
||
| 33 | { |
||
| 34 | return $this->table; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Get all properties with relational models in array form. |
||
| 39 | * |
||
| 40 | * @return array<mixed> |
||
| 41 | */ |
||
| 42 | public function getProperties(): array |
||
| 43 | { |
||
| 44 | return $this->__properties['all']; |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Get self properties without relations in array form. |
||
| 49 | * |
||
| 50 | * @return array<mixed> |
||
| 51 | */ |
||
| 52 | public function getSelfProperties(): array |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Get all property types in array form. |
||
| 59 | * |
||
| 60 | * @return array<mixed> |
||
| 61 | */ |
||
| 62 | public function getTypes(): array |
||
| 63 | { |
||
| 64 | return $this->__properties['type']; |
||
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * returns all relational models. |
||
| 69 | */ |
||
| 70 | public function getForeignModels(string $type): Collection |
||
| 73 | } |
||
| 74 | } |
||
| 75 |