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