public function load(Identifier $identifier, $document = null, $lockMode = LockMode::NONE)
    {
        $qb     = $this->dm->createQueryBuilder($this->class->name);
        $query  = $qb->get()->setIdentifier($identifier)->getQuery();
        $result = $query->getSingleMarshalledResult();

        return $result ? $this->createDocument($result, $document) : null;
    }
public function load(Identifier $identifier, $document = null, $lockMode = LockMode::NONE)
    {
        $qb     = $this->dm->createQueryBuilder($this->class->name);
        $query  = $qb->get()->setIdentifier($identifier)->getQuery();
        $result = $query->getSingleMarshalledResult();

        return $result ? $this->createDocument($result, $document) : null;
    }
public function load ( Identifier $ identifier , $ document = null , $ lockMode = LockMode :: NONE ) { $ qb = $ this -> dm -> createQueryBuilder ( $ this -> class -> name ) ; $ query = $ qb -> get ( ) -> setIdentifier ( $ identifier ) -> getQuery ( ) ; $ result = $ query -> getSingleMarshalledResult ( ) ; return $ result ? $ this -> createDocument ( $ result , $ document ) : null ; }
Find a document by Identifier instance.

@param Identifier  $identifier
@param object|null $document Document to load the data into. If not
specified, a new document is created.
@param int         $lockMode

@return object|null The loaded and managed document instance or null if
no document was found
Find a document by Identifier instance .