public function find($documentName, $identifier, $lockMode = LockMode::NONE, $lockVersion = null) : ?object
    {
        $repository = $this->getRepository($documentName);
        if ($repository instanceof DocumentRepository) {
            return $repository->find($identifier, $lockMode, $lockVersion);
        }

        return $repository->find($identifier);
    }
public function find($documentName, $identifier, $lockMode = LockMode::NONE, $lockVersion = null) : ?object
    {
        $repository = $this->getRepository($documentName);
        if ($repository instanceof DocumentRepository) {
            return $repository->find($identifier, $lockMode, $lockVersion);
        }

        return $repository->find($identifier);
    }
public function find ( $ documentName , $ identifier , $ lockMode = LockMode :: NONE , $ lockVersion = null ) : ? object { $ repository = $ this -> getRepository ( $ documentName ) ; if ( $ repository instanceof DocumentRepository ) { return $ repository -> find ( $ identifier , $ lockMode , $ lockVersion ) ; } return $ repository -> find ( $ identifier ) ; }
Finds a Document by its identifier.

This is just a convenient shortcut for getRepository($documentName)->find($id).

@param string $documentName
@param mixed  $identifier
@param int    $lockMode
@param int    $lockVersion
Finds a Document by its identifier .