public function getRepository($className)
    {
        if (isset($this->repositories[$className])) {
            return $this->repositories[$className];
        }

        $metadata = $this->getClassMetadata($className);
        $customRepositoryClassName = $metadata->getCustomRepositoryClassName();

        if ($customRepositoryClassName !== null) {
            $repository = new $customRepositoryClassName($this, $this->unitOfWork, $metadata);
        } else {
            $repository = new ModelRepository($this, $this->unitOfWork, $metadata);
        }

        $this->repositories[$className] = $repository;

        return $repository;
    }
public function getRepository($className)
    {
        if (isset($this->repositories[$className])) {
            return $this->repositories[$className];
        }

        $metadata = $this->getClassMetadata($className);
        $customRepositoryClassName = $metadata->getCustomRepositoryClassName();

        if ($customRepositoryClassName !== null) {
            $repository = new $customRepositoryClassName($this, $this->unitOfWork, $metadata);
        } else {
            $repository = new ModelRepository($this, $this->unitOfWork, $metadata);
        }

        $this->repositories[$className] = $repository;

        return $repository;
    }
public function getRepository ( $ className ) { if ( isset ( $ this -> repositories [ $ className ] ) ) { return $ this -> repositories [ $ className ] ; } $ metadata = $ this -> getClassMetadata ( $ className ) ; $ customRepositoryClassName = $ metadata -> getCustomRepositoryClassName ( ) ; if ( $ customRepositoryClassName !== null ) { $ repository = new $ customRepositoryClassName ( $ this , $ this -> unitOfWork , $ metadata ) ; } else { $ repository = new ModelRepository ( $ this , $ this -> unitOfWork , $ metadata ) ; } $ this -> repositories [ $ className ] = $ repository ; return $ repository ; }
Returns the model repository instance given by model name.

@param string $className The name of the Model

@return ModelRepository The repository
Returns the model repository instance given by model name .