コード例 #1
0
 /**
  * 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);
 }
コード例 #2
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);
 }
コード例 #3
0
 /**
  * @return VersionRepositoryInterface
  */
 public function getVersionRepository()
 {
     return $this->registry->getRepository('Pim\\Bundle\\VersioningBundle\\Model\\Version');
 }