/** * 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); }
/** * @return VersionRepositoryInterface */ public function getVersionRepository() { return $this->registry->getRepository('Pim\\Bundle\\VersioningBundle\\Model\\Version'); }