Conditions | 3 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | public function handle($object) |
||
24 | { |
||
25 | $class = get_class($object); |
||
26 | |||
27 | $metadata = $this->registry |
||
28 | ->getManagerForClass($class) |
||
29 | ->getClassMetadata($class); |
||
30 | $identifier = $metadata->getIdentifierValues($object); |
||
31 | |||
32 | if (!$metadata instanceof ClassMetadata || $metadata->isIdentifierComposite) { |
||
33 | return $identifier; |
||
34 | } |
||
35 | |||
36 | return array_shift($identifier); |
||
37 | } |
||
38 | } |
||
39 |