/**
  * {@inheritdoc}
  */
 public function denormalize($data, $class, $format = null, array $context = [])
 {
     $values = new ArrayCollection();
     $attributeRepo = $this->registry->getRepository($this->attributeClass);
     foreach ($data as $attributeCode => $valuesData) {
         $attribute = $attributeRepo->findOneByIdentifier($attributeCode);
         foreach ($valuesData as $valueData) {
             $value = $this->denormalizer->denormalize($valueData, $this->valueClass, 'json', ['attribute' => $attribute] + $context);
             $values->add($value);
         }
     }
     return $values;
 }
 /**
  * @return VersionRepositoryInterface
  */
 public function getVersionRepository()
 {
     return $this->registry->getRepository('Akeneo\\Component\\Versioning\\Model\\Version');
 }
 /**
  * Checks if the given class is real entity class
  *
  * @param string $className
  *
  * @return bool
  */
 public function isEntity($className)
 {
     return !is_null($this->doctrine->getManagerForClass($className));
 }
 /**
  * @return \Pim\Bundle\VersioningBundle\Repository\VersionRepositoryInterface
  */
 public function getVersionRepository()
 {
     return $this->registry->getRepository('Pim\\Bundle\\VersioningBundle\\Model\\Version');
 }
 /**
  * Returns the manager for an entity
  *
  * @param object|string $entity
  *
  * @return \Doctrine\Common\Persistence\ObjectManager
  */
 protected function getManager($entity)
 {
     return $this->doctrine->getManagerForClass(is_object($entity) ? ClassUtils::getClass($entity) : $entity);
 }
 public function let(SmartManagerRegistry $doctrine, EntityRepository $repository, EntityManager $entityManager, PropertyAccessorInterface $propertyAccessor)
 {
     $doctrine->getRepository('entity_class')->willReturn($repository);
     $doctrine->getManagerForClass('stdClass')->willReturn($entityManager);
     $this->beConstructedWith($doctrine, $propertyAccessor);
 }