Total Complexity | 9 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
13 | final class StdMapper extends DatabaseMapper |
||
14 | { |
||
15 | 352 | public function init(array $data, ?string $role = null): object |
|
18 | } |
||
19 | |||
20 | 352 | public function hydrate($entity, array $data): object |
|
37 | } |
||
38 | |||
39 | 352 | public function extract($entity): array |
|
40 | { |
||
41 | 352 | return \get_object_vars($entity); |
|
42 | } |
||
43 | |||
44 | /** |
||
45 | * Get entity columns. |
||
46 | */ |
||
47 | 184 | public function fetchFields(object $entity): array |
|
48 | { |
||
49 | 184 | return \array_intersect_key( |
|
50 | 184 | $this->extract($entity), |
|
51 | 184 | $this->columns + $this->parentColumns, |
|
52 | ); |
||
53 | } |
||
54 | |||
55 | 136 | public function fetchRelations(object $entity): array |
|
60 | ); |
||
61 | } |
||
62 | } |
||
63 |