コード例 #1
0
 /**
  * {@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;
 }
コード例 #2
0
 /**
  * @return VersionRepositoryInterface
  */
 public function getVersionRepository()
 {
     return $this->registry->getRepository('Akeneo\\Component\\Versioning\\Model\\Version');
 }
コード例 #3
0
 /**
  * @return \Pim\Bundle\VersioningBundle\Repository\VersionRepositoryInterface
  */
 public function getVersionRepository()
 {
     return $this->registry->getRepository('Pim\\Bundle\\VersioningBundle\\Model\\Version');
 }
コード例 #4
0
 /**
  * {@inheritdoc}
  */
 public function find($entityClass, $id, array $options = array())
 {
     return $this->doctrine->getRepository($entityClass)->find($id);
 }
コード例 #5
0
 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);
 }