getRepository

@param string $entityName, the name of the entity
@param string $db, name of the db to connect to
@return \Doctrine\ORM\EntityRepository The repository class
166989
public function getRepository($entityName, $db = null)
    {
        return \erdiko\doctrine\EntityManager::getEntityManager()->getRepository($entityName);
    }
815867
protected function getEntity($entityId)
    {
        $entity = $this->getRepository()->get($entityId);
        if (!$entity instanceof EntityInterface) {
            throw new EntityNotFoundException(
                "There are no entities with provided entity ID."
            );
        }
        return $entity;
    }
560459
public function getRepository(EntityManagerInterface $entityManager, $className) {
		if(!isset($this->repositories[$className])) {
			$this->repositories[$className] = $this->generateRepository($entityManager, $className);
		}
		return $this->repositories[$className];
	}
406237
public function findRepository(string $appName): ? AppRepository
    {
        return isset($this->repositories[$appName])
            ? $this->repositories[$appName]
            : null;
    }
398504
public function getRepository($entityClass)
    {
        if (is_object($entityClass)) {
            $entityClass = get_class($entityClass);
        }

        if (!isset($this->repositories[$entityClass])) {
            throw new \Exception("no repository defined for: $entityClass");
        }

        if (!is_object($this->repositories[$entityClass])) {
            $this->repositories[$entityClass] = $this->di->get($this->repositories[$entityClass]);
        }

        return $this->repositories[$entityClass];
    }
1322790
private function getRepository($classname)
    {
        $om = ManagerUtils::getManager($this->doctrine, $classname);

        return null !== $om ? $om->getRepository($classname) : null;
    }
804425
public function getRepository()
    {
        if (!$this->_repository instanceof AnDomainRepositoryAbstract) {
            if (!$this->_repository instanceof AnServiceIdentifier) {
                $this->setRepository($this->_repository);
            }

            $this->_repository = $this->getService($this->_repository);
        }

        return $this->_repository;
    }
363897
public function getEntity()
    {
        $entity = $this->entityManager->getRepository($this->className)->find($this->id);
        if (!$entity) {
            throw new Error('Entity not found for class `' . $this->className . '` and ID `' . $this->id . '`.');
        }

        return $entity;
    }
925923
public function getRepository()
    {
        if (!$this->_repository instanceof AnDomainRepositoryAbstract) {
            if (!$this->_repository instanceof AnServiceIdentifier) {
                $this->setRepository($this->_repository);
            }

            $this->_repository = AnDomain::getRepository($this->_repository);
        }

        return $this->_repository;
    }
485110
public function get($entityId)
    {
        $key = $this->getEntityDescriptor()->className();
        $key .= '::'.$entityId;
        $entity = $this->getIdentityMap()->get($key, false);
        if ($entity === false) {
            $entity = $this->load($entityId);
        }
        return $entity;
    }
1111800
private function createRepository(EntityManagerInterface $entityManager, $entityName)
    {
        /** @var ClassMetadata $metadata */
        $metadata            = $entityManager->getClassMetadata($entityName);
        $repositoryClassName = $metadata->getCustomRepositoryClassName()
            ?: $entityManager->getConfiguration()->getDefaultRepositoryClassName();

        return new $repositoryClassName($entityManager, $metadata);
    }
631569
public function getGeonamesEntityRepository() 
    {
    	if(isset($this->er['Geonames'])) {
    		return $this->er['Geonames'];
    	}
    	$this->er['Geonames'] = $this->getEntityManager()->getRepository('Neobazaar\Entity\Geonames');
    	
    	return $this->er['Geonames'];
    }
1186257
public function getUserEntityRepository() 
    {
    	if(isset($this->er['User'])) {
    		return $this->er['User'];
    	}
    	$entityRepository = $this->getEntityManager()->getRepository('Neobazaar\Entity\User');
    	$entityRepository->setServiceLocator($this->getServiceManager());
    	$this->er['User'] = $entityRepository;
    	
    	return $this->er['User'];
    }
778780
public function getOne($repository, $id)
    {
        $repoConfig = $this->repos[$repository];
        /** @var $q \Doctrine\ORM\QueryBuilder */
        return $this->doctrine
            ->getRepository($repoConfig['repository'])
            ->find($id);
    }
1332095
public function getDocumentDatabase(string $className) : Database
    {
        $className = $this->classNameResolver->getRealClass($className);

        if (isset($this->documentDatabases[$className])) {
            return $this->documentDatabases[$className];
        }

        $metadata = $this->metadataFactory->getMetadataFor($className);
        assert($metadata instanceof ClassMetadata);

        $db                                  = $metadata->getDatabase();
        $db                                  = $db ?: $this->config->getDefaultDB();
        $db                                  = $db ?: 'doctrine';
        $this->documentDatabases[$className] = $this->client->selectDatabase($db);

        return $this->documentDatabases[$className];
    }
1232705
public function getRepository($name = null)
    {
        if (is_null($name) || empty($name)) {
            $manager_class = get_class($this);
            $name = str_replace(array('\\Manager\\', 'Manager', '\\'), array(':', '', ''), $manager_class);
            $name = str_replace(
                array('\\Manager\\', '\\Bundle\\', 'Manager', '\\'),
                array(':', '', ''),
                $manager_class
            );
        }

        return $this->container->get('doctrine.orm.entity_manager')->getRepository($name);
    }
753691
public function to(string $entityType, string $tableName = null) : RelationDefiner
    {
        return new RelationDefiner($this->callback, function () use ($entityType, $tableName) {
            return $this->orm->getEntityMapper($entityType, $tableName);
        });
    }