| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 49 | public function denormalize($identifier, $class) |
||
| 50 | { |
||
| 51 | $manager = $this->registry->getManagerForClass($class); |
||
| 52 | |||
| 53 | if (null === $manager) { |
||
| 54 | throw new \RuntimeException('Not supported class '.$class); |
||
| 55 | } |
||
| 56 | |||
| 57 | if ($manager instanceof EntityManagerInterface) { |
||
| 58 | return $manager->getReference($class, $identifier); |
||
| 59 | } |
||
| 60 | |||
| 61 | return $manager->find($class, $identifier); |
||
| 62 | } |
||
| 63 | } |
||
| 64 |