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