lib/Doctrine/ODM/MongoDB/DocumentManager.php
public function getReference($documentName, $identifier)
    {
        /* @var $class \Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo */
        $class = $this->metadataFactory->getMetadataFor(ltrim($documentName, '\\'));

        // Check identity map first, if its already in there just return it.
        if ($document = $this->unitOfWork->tryGetById($identifier, $class)) {
            return $document;
        }

        $document = $this->proxyFactory->getProxy($class->name, array($class->identifier => $identifier));
        $this->unitOfWork->registerManaged($document, $identifier, array());

        return $document;
    }
public function getReference($documentName, $identifier)
    {
        /* @var $class \Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo */
        $class = $this->metadataFactory->getMetadataFor(ltrim($documentName, '\\'));

        // Check identity map first, if its already in there just return it.
        if ($document = $this->unitOfWork->tryGetById($identifier, $class)) {
            return $document;
        }

        $document = $this->proxyFactory->getProxy($class->name, array($class->identifier => $identifier));
        $this->unitOfWork->registerManaged($document, $identifier, array());

        return $document;
    }
public function getReference ( $ documentName , $ identifier ) { /* @var $class \Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo */ $ class = $ this -> metadataFactory -> getMetadataFor ( ltrim ( $ documentName , '\\' ) ) ; // Check identity map first, if its already in there just return it. if ( $ document = $ this -> unitOfWork -> tryGetById ( $ identifier , $ class ) ) { return $ document ; } $ document = $ this -> proxyFactory -> getProxy ( $ class -> name , array ( $ class -> identifier => $ identifier ) ) ; $ this -> unitOfWork -> registerManaged ( $ document , $ identifier , array ( ) ) ; return $ document ; }
Gets a reference to the document identified by the given type and identifier
without actually loading it.

If partial objects are allowed, this method will return a partial object that only
has its identifier populated. Otherwise a proxy is returned that automatically
loads itself on first access.

@param string $documentName
@param string|object $identifier
@return mixed|object The document reference.
Gets a reference to the document identified by the given type and identifier without actually loading it .