Resolver/EntityAnnotationResolver.php
private function resolveRepositoryLookup(
        LoadEntity $annotation,
        string $entityClass,
        array $mapping
    ) {
        $annotationRepository = $annotation->getRepository();
        $annotationHasRepository = !is_null($annotationRepository) && is_array($annotationRepository);
        if ($annotationHasRepository) {
            $class = $annotation->getRepository()['class'];
            $repository = $this
                    ->container
                    ->has($class)
                ? $this
                    ->container
                    ->get($class)
                : new $class();
        } else {
            $repository = $this
                ->doctrine
                ->getManagerForClass($entityClass)
                ->getRepository($entityClass);
        }

        $method = $annotationHasRepository && isset($annotationRepository['method'])
            ? $annotationRepository['method']
            : 'findOneBy';

        return $repository->$method($mapping);
    }
private function resolveRepositoryLookup(
        LoadEntity $annotation,
        string $entityClass,
        array $mapping
    ) {
        $annotationRepository = $annotation->getRepository();
        $annotationHasRepository = !is_null($annotationRepository) && is_array($annotationRepository);
        if ($annotationHasRepository) {
            $class = $annotation->getRepository()['class'];
            $repository = $this
                    ->container
                    ->has($class)
                ? $this
                    ->container
                    ->get($class)
                : new $class();
        } else {
            $repository = $this
                ->doctrine
                ->getManagerForClass($entityClass)
                ->getRepository($entityClass);
        }

        $method = $annotationHasRepository && isset($annotationRepository['method'])
            ? $annotationRepository['method']
            : 'findOneBy';

        return $repository->$method($mapping);
    }
private function resolveRepositoryLookup ( LoadEntity $ annotation , string $ entityClass , array $ mapping ) { $ annotationRepository = $ annotation -> getRepository ( ) ; $ annotationHasRepository = ! is_null ( $ annotationRepository ) && is_array ( $ annotationRepository ) ; if ( $ annotationHasRepository ) { $ class = $ annotation -> getRepository ( ) [ 'class' ] ; $ repository = $ this -> container -> has ( $ class ) ? $ this -> container -> get ( $ class ) : new $ class ( ) ; } else { $ repository = $ this -> doctrine -> getManagerForClass ( $ entityClass ) -> getRepository ( $ entityClass ) ; } $ method = $ annotationHasRepository && isset ( $ annotationRepository [ 'method' ] ) ? $ annotationRepository [ 'method' ] : 'findOneBy' ; return $ repository -> $ method ( $ mapping ) ; }
Resolve repository lookup.

@param LoadEntity $annotation
@param string     $entityClass
@param array      $mapping

@return object|null
Resolve repository lookup .