lib/Doctrine/ODM/MongoDB/DocumentManager.php
public function getRepository($documentName)
    {
        $documentName = ltrim($documentName, '\\');

        if (isset($this->repositories[$documentName])) {
            return $this->repositories[$documentName];
        }

        $metadata = $this->getClassMetadata($documentName);
        $customRepositoryClassName = $metadata->customRepositoryClassName;

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

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

        return $repository;
    }
public function getRepository($documentName)
    {
        $documentName = ltrim($documentName, '\\');

        if (isset($this->repositories[$documentName])) {
            return $this->repositories[$documentName];
        }

        $metadata = $this->getClassMetadata($documentName);
        $customRepositoryClassName = $metadata->customRepositoryClassName;

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

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

        return $repository;
    }
public function getRepository ( $ documentName ) { $ documentName = ltrim ( $ documentName , '\\' ) ; if ( isset ( $ this -> repositories [ $ documentName ] ) ) { return $ this -> repositories [ $ documentName ] ; } $ metadata = $ this -> getClassMetadata ( $ documentName ) ; $ customRepositoryClassName = $ metadata -> customRepositoryClassName ; if ( $ customRepositoryClassName !== null ) { $ repository = new $ customRepositoryClassName ( $ this , $ this -> unitOfWork , $ metadata ) ; } else { $ repository = new DocumentRepository ( $ this , $ this -> unitOfWork , $ metadata ) ; } $ this -> repositories [ $ documentName ] = $ repository ; return $ repository ; }
Gets the repository for a document class.

@param string $documentName  The name of the Document.
@return DocumentRepository  The repository.
Gets the repository for a document class .