public function createReference()
    {
        $documentId = $this->getId();
        if (null === $documentId) {
            throw new Exception('Document must be stored to get DBRef');
        }

        return $this
            ->getCollection()
            ->getMongoCollection()
            ->createDBRef($documentId);
    }
public function createReference()
    {
        $documentId = $this->getId();
        if (null === $documentId) {
            throw new Exception('Document must be stored to get DBRef');
        }

        return $this
            ->getCollection()
            ->getMongoCollection()
            ->createDBRef($documentId);
    }
public function createReference ( ) { $ documentId = $ this -> getId ( ) ; if ( null === $ documentId ) { throw new Exception ( 'Document must be stored to get DBRef' ) ; } return $ this -> getCollection ( ) -> getMongoCollection ( ) -> createDBRef ( $ documentId ) ; }
Get reference to document

@throws Exception
@return array
Get reference to document