@param $entityName

@return \Fredy\Model\Repository\Repository
173902
function getRepository($entityName)
    {
        if (isset($this->cachedRepository[$entityName])) {
            return $this->cachedRepository[$entityName];
        }
        $className = "Fredy\\Model\\Repository\\Repository";
        $entityClassName = 'Model\\Entity\\'.$entityName;
        return new $className(new $entityClassName(),$this->db);
    }
371589
public function getRepositoryForClassName($className)
    {
        if (array_key_exists($className, $this->repositories)) {
            return $this->repositories[$className];
        }

        throw new RepositoryNotFoundException($className);
    }
518987
protected function getRepository($persistentObjectName, $persistentManagerName = null)
    {
        return $this->container->get('doctrine')->getRepository($persistentObjectName, $persistentManagerName);
    }
166989
public function getRepository($entityName, $db = null)
    {
        return \erdiko\doctrine\EntityManager::getEntityManager()->getRepository($entityName);
    }
59499
public function getRepository($modelName, $collection = null)
    {
        return $this->repositoryFactory->getRepository($this, $modelName, $collection);
    }
480720
public function getRepository($name = null)
    {
        $doctrine = $this->getDoctrine();

        if ($name) {
            return $doctrine->getRepository($name);
        }

        return $doctrine->getRepository($this->getClass());
    }
461539
public function documentToEntity($document, string $entityClassName)
    {
        if (!$this->annotationParser->isEntityClass($entityClassName)) {
            return $document;
        }

        try {
            $reflectClass = new \ReflectionClass($entityClassName);
        } catch (\Exception $exception) {
            return $document;
        }

        $entity = new $entityClassName();

        foreach ($reflectClass->getProperties() as $documentProperty) {
            if ($documentProperty->isStatic()) {
                continue;
            }

            $annotation = $this->annotationParser->getPropertyAnnotation($documentProperty);
            if (null === $annotation) {
                continue;
            }

            $propertyName = $annotation->name ?? $documentProperty->getName();
            if ($annotation->id) {
                $propertyName = '_id';
            }
            $propertyValue = $document->{$propertyName} ?? null;
            $fieldValue = $this->propertyToField($propertyValue, $annotation);

            $documentProperty->setAccessible(true);
            $documentProperty->setValue($entity, $fieldValue);
        }

        return $entity;
    }
646477
public function find($entityName, $identifier, $lockMode = LockMode::NONE, $lockVersion = null)
    {
        return $this->getRepository($entityName)->find($identifier, $lockMode, $lockVersion);
    }
338687
private function getEntityClassName($entityName)
    {
        if (!isset($this->entityClassMap[ $entityName ])) {
            $className = $entityName;
            if (!class_exists($className)) {
                $className = $this->defaultNamespace . $entityName;
                if (!class_exists($className)) {
                    //Cache that the class does not exist
                    $className = false;
                }
            }
            $this->entityClassMap[ $entityName ] = $className;
        }

        if ($this->entityClassMap[ $entityName ] === false) {
            throw new \OutOfBoundsException("Unknown entity {$entityName}");
        }

        return $this->entityClassMap[ $entityName ];
    }
887481
public function getRepository($repositoryName)
    {
        if (array_key_exists($repositoryName, $this->repositories))
        {
            return $this->repositories[$repositoryName];
        }

        throw new AnyContentClientException('Unknown repository ' . $repositoryName);
    }
739105
protected function getDomain($domainName)
    {
        $entityManager = $this->getEntityManager();

        /** @var \Rcm\Repository\Domain $domainRepo */
        $domainRepo = $entityManager->getRepository(
            \Rcm\Entity\Domain::class
        );

        $domain = $domainRepo->getDomainByName($domainName);

        if (!$domain instanceof Domain) {
            throw new \Exception("Domain {$domainName} could not be found.");
        }

        return $domain;
    }
763120
public function getRepository()
    {
        if ($this->repository === null) {
            $this->repository = $this->entityManager->getRepository($this->entityName);
        }

        return $this->repository;
    }
340693
public function createDoctrineDetails(string $entityClassName)
    {
        $metadata = $this->getMetadata($entityClassName);

        if ($metadata instanceof ClassMetadata) {
            return new EntityDetails($metadata);
        }

        return null;
    }
1193391
public function loadUserByUsername($username)
    {
        /** @var EntityManager $doctrine */
        $doctrine = $this->doctrine->getManager();

        return $doctrine->getRepository($this->userClass)->findOneBy(['username' => $username]);
    }
1150821
protected function getTableName($entityName)
    {
        $tableName = $entityName;
        preg_match_all('/[A-Z][a-z]+/', $entityName, $matches);
        if (!empty($matches[0])) {
            $tableName = implode('_', $matches[0]);
        }
        return strtolower($tableName);
    }
104643
public function hydrateEntity($entityName, $identifier) {
    return $this->getDoctrinePackage()->getRepository(
      $this->getDoctrinePackage()->getModule()->getEntityName($entityName)
    )->hydrate($identifier);
  }
965548
public function mapper($entityName)
    {
        if (!class_exists($entityName)) {
            throw new \Exception('Unable to get mapper for unknown entity class '.$entityName);
        }
        $locator = $this['spot2.locator'];

        return $locator->mapper($entityName);
    }