diff --git a/src/ContainerAwareManager.php b/src/ContainerAwareManager.php index fe7882b..ec47905 100644 --- a/src/ContainerAwareManager.php +++ b/src/ContainerAwareManager.php @@ -2,6 +2,7 @@ namespace Paymaxi\FractalBundle; +use Doctrine\Common\Util\ClassUtils; use League\Fractal\Manager; use League\Fractal\Resource\Collection; use League\Fractal\Resource\Item; @@ -63,9 +64,9 @@ private function resolveTransformer(ResourceInterface $resource) $serviceRegistry = $this->container->get('fractal.transformer.resolvers'); if ($resource instanceof Item) { - $instance = get_class($resource->getData()); + $instance = ClassUtils::getRealClass(get_class($resource->getData())); } elseif ($resource instanceof Collection) { - $instance = get_class($resource->getData()[0]); + $instance = ClassUtils::getRealClass(get_class($resource->getData()[0])); } else { return; }