| Conditions | 3 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | public function convert($entity) |
||
| 29 | { |
||
| 30 | $class = get_class($entity); |
||
| 31 | $metadata = $this->registry->getManagerForClass($class)->getClassMetadata($class); |
||
| 32 | |||
| 33 | $ids = $metadata->getIdentifierValues($entity); |
||
| 34 | |||
| 35 | if (!$metadata instanceof ClassMetadata || $metadata->isIdentifierComposite) { |
||
| 36 | return $ids; |
||
| 37 | } |
||
| 38 | |||
| 39 | return array_shift($ids); |
||
| 40 | } |
||
| 41 | } |
||
| 42 |