| Total Complexity | 7 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | trait Getter |
||
| 6 | { |
||
| 7 | |||
| 8 | /** |
||
| 9 | * Get current model Id or UUID |
||
| 10 | * @return mixed |
||
| 11 | */ |
||
| 12 | public function getId(): mixed |
||
| 13 | { |
||
| 14 | return $this->__meta['id']; |
||
| 15 | } |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Get current table name of model |
||
| 19 | * @return string |
||
| 20 | */ |
||
| 21 | public function getName(): string |
||
| 22 | { |
||
| 23 | return $this->table; |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Get all properties with relational models in array form |
||
| 28 | * @return array<mixed> |
||
| 29 | */ |
||
| 30 | public function getProperties(): array |
||
| 31 | { |
||
| 32 | return $this->__properties['all']; |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Get self properties without relations in array form |
||
| 37 | * @return array<mixed> |
||
| 38 | */ |
||
| 39 | public function getSelfProperties(): array |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Get all property types in array form |
||
| 46 | * @return array<mixed> |
||
| 47 | */ |
||
| 48 | public function getTypes(): array |
||
| 49 | { |
||
| 50 | return $this->__properties['type']; |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * returns all relational models |
||
| 55 | * @param string $type |
||
| 56 | * @return Collection |
||
| 57 | */ |
||
| 58 | public function getForeignModels(string $type): Collection |
||
| 61 | } |
||
| 62 | |||
| 63 | |||
| 64 | |||
| 65 | } |