getRepository.

@param string $name

@return \Doctrine\Common\Persistence\ObjectRepository
480720
public function getRepository($name = null)
    {
        $doctrine = $this->getDoctrine();

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

        return $doctrine->getRepository($this->getClass());
    }
952165
public function getModel($name = null, $source = null, $forceNew = false)
    {
        return $this->getRepository($name, $source, $forceNew);
    }
487215
public function get($name)
    {
        /** @var Repository $repository */
        foreach ($this->repositories as $repository) {
            if ($repository->getName() == $name) {
                return $repository;
            }
        }

        return null;
    }
56714
private function getSharingRepository()
    {
        if (null === $this->sharingRepo) {
            $this->sharingRepo = $this->getRepository(SharingInterface::class);
        }

        return $this->sharingRepo;
    }
577198
public function getRepository(string $name): RepositoryInterface
    {
        if (isset($this->repositories[$name])) {
            return $this->repositories[$name];
        }

        throw new \LogicException(sprintf('Unknown repository "%s"', $name));
    }
1000193
public function getProperty($name)
    {
        $result = null;
        if($entity = $this->getIterator()->current()) {
            $result = $entity->getProperty($name);
        }

        return $result;
    }
801111
public function getRepository($type)
    {
        try {
            $ldapObjectSchema = $this->getLdapObjectSchema($type);
            $repositoryClass = $ldapObjectSchema->getRepository();
            if (!class_exists($repositoryClass)) {
                throw new \RuntimeException(sprintf('Repository class "%s" not found.', $repositoryClass));
            }
            $repository = new $repositoryClass($ldapObjectSchema, $this->getConnection());
            if (!($repository instanceof LdapObjectRepository)) {
                throw new \RuntimeException('Your repository class must extend \LdapTools\Object\LdapObjectRepository.');
            }
        } catch (\Exception $e) {
            throw new \RuntimeException(sprintf('Unable to load Repository for type "%s": %s', $type, $e->getMessage()));
        } catch (\Throwable $e) {
            throw new \RuntimeException(sprintf('Unable to load Repository for type "%s": %s', $type, $e->getMessage()));
        }

        return $repository;
    }
1019193
protected function getRepository()
    {
        if (null === $this->repository) {
            $this->repository = $this->getEntityManager()
                    ->getRepository($this->getModuleNamespace() . '\Entity\\' . $this->getEntityName());
        }
        return $this->repository;
    }
1338336
public function getRepository($abstract) {
        $entityClass = $this->repositoryNameParser
            ->convertRepositoryNameToEntityName($abstract);

        if ( ! class_exists($entityClass)) {
            throw new RepositoryNotFoundException(s(
                'Could not find repository "%s", ' .
                'with derived entity class "%s".',
                $abstract, $entityClass
            ));
        }

        return $this->objectManager->getRepository($entityClass);
    }
1137861
public function getRepository($name = null)
    {
        // Resolve repository class name
        $repositoryName = $this->resolveRepositoryClassName($name);

        return new $repositoryName($this->getValidator(), $this->config);
    }
898115
public function getRepository($name = null, $source = null, $forceNew = false)
    {
        $name = $name ?: $this->getName();

        $key = ModelResolver::getDIKey($name);

        // Let's prepare controller getter.
        if (!$this->container->exists($key)) {
            // Use resolver to find model class and create it.
            $this->container->share($key, function (Container $container) use ($name, $source) {
                $config    = clone $this->config;
                $modelName = ucfirst($name) . 'Model';
                $repoName  = ucfirst($name) . 'Repository';
                $source    = $source ?: $this->getDataSource();

                /*
                 * If the name of this model not same as this controller, we don't pass name into it,
                 * so that the model will keep it's own name.
                 * Otherwise we override the name in model config with ours.
                 */
                if ($name && strcasecmp($name, $this->getName()) !== 0) {
                    $config['name'] = null;
                }

                try {
                    $repoResolver = $this->getPackage()->getMvcResolver()->getRepositoryResolver();

                    // Use RepositoryResolver to fin Repository class
                    try {
                        $class = $repoResolver->resolve($repoName);
                    } catch (\DomainException $e) {
                        // Use ModelResolver to get legacy Model classes
                        // @deprecated
                        $class = $repoResolver->getModelResolver()->resolve($modelName);
                    }

                    // Create object by container, container will auto inject all necessary dependencies
                    return $container->createSharedObject($class, ['config' => $config]);
                } catch (\Exception $e) {
                    if (!$e instanceof \DomainException && !$e instanceof \UnexpectedValueException) {
                        throw $e;
                    }

                    // Guess the repository position
                    $class = MvcHelper::getPackageNamespace($this) . '\Repository\\' . ucfirst($repoName);

                    if (class_exists($class)) {
                        return $container->createSharedObject($class, ['source' => $source, 'config' => $config]);
                    }

                    // Guess the model position
                    // @deprecated
                    $class = MvcHelper::getPackageNamespace($this) . '\Model\\' . ucfirst($modelName);

                    if (class_exists($class)) {
                        return $container->createSharedObject($class, ['source' => $source, 'config' => $config]);
                    }

                    $config['name'] = $name;

                    return new Repository($config);
                }
            });
        }

        // Get model from controller.
        return $this->container->get($key, $forceNew);
    }
701182
public function getRepository($entityName)
    {
        if (isset($this->repositories[$entityName])) {
            return $this->repositories[$entityName];
        }

        $metadata = $this->getClassMetadata($entityName);
        $repository = new EntityRepository($this, $metadata);
        $this->repositories[$entityName] = $repository;

        return $repository;
    }
246691
public function repository($name = null)
    {
        $name = $name ?: $this->getDefaultDriver();

        return $this->repositories[$name] = $this->get($name);
    }
646251
protected function getRepository ($persistentObject = null) : EntityRepository
    {
        if (null === $persistentObject)
        {
            $persistentObject = $this->getFullEntityName();
        }

        return $this->doctrine->getRepository($persistentObject);
    }
356210
public function findOneByName($name)
    {
        $entityClass = $this->getEntityClass();

        return $this->getObjectManager()
                    ->getRepository($entityClass)
                    ->findOneByName($name);
    }
371589
public function getRepositoryForClassName($className)
    {
        if (array_key_exists($className, $this->repositories)) {
            return $this->repositories[$className];
        }

        throw new RepositoryNotFoundException($className);
    }
1118205
private function getProvinceByName($name)
    {
        $province = $this->provinceRepository->findOneBy(['name' => $name]);
        Assert::notNull(
            $province,
            sprintf('Province with name %s does not exist.', $name)
        );

        return $province;
    }