Skip to content

Commit

Permalink
Merge pull request #16 from dunglas/fix_api_platform_267
Browse files Browse the repository at this point in the history
Always use ClassUtils to guess the class name
  • Loading branch information
dunglas authored Apr 3, 2017
2 parents 68b8a3a + 6d10ceb commit c2c0b44
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Normalizer/ObjectNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace Dunglas\DoctrineJsonOdm\Normalizer;

use Doctrine\Common\Util\ClassUtils;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\SerializerAwareInterface;
Expand Down Expand Up @@ -43,7 +44,7 @@ public function __construct(NormalizerInterface $objectNormalizer)
*/
public function normalize($object, $format = null, array $context = [])
{
return array_merge(['#type' => get_class($object)], $this->objectNormalizer->normalize($object, $format, $context));
return array_merge(['#type' => ClassUtils::getClass($object)], $this->objectNormalizer->normalize($object, $format, $context));
}

/**
Expand Down

0 comments on commit c2c0b44

Please sign in to comment.