Total Complexity | 3 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | final class MapperPrimaryKey implements KeyInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var Mapper |
||
14 | */ |
||
15 | private $mapper; |
||
16 | |||
17 | /** |
||
18 | * EntityPrimaryKey constructor. |
||
19 | * |
||
20 | * @param Mapper $mapper |
||
21 | */ |
||
22 | 16 | public function __construct(Mapper $mapper) |
|
25 | 16 | } |
|
26 | |||
27 | /** |
||
28 | * {@inheritdoc} |
||
29 | */ |
||
30 | 13 | public function name(): string |
|
31 | { |
||
32 | 13 | return $this->mapper->metadata()->primary['attributes'][0]; |
|
33 | } |
||
34 | |||
35 | /** |
||
|
|||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | 8 | public function get($entity) |
|
41 | } |
||
42 | } |
||
43 |