public function find($entityName, $id, $lockMode = null, $lockVersion = null)
    {
        try{
            return $this->entityManager->find($entityName, $id, $lockMode, $lockVersion);
        } catch(ORMException $e) {
            if (!$this->entityManager->isOpen()) {
                $this->resetEntityManager();
            }
            throw $e;
        }
    }
public function find($entityName, $id, $lockMode = null, $lockVersion = null)
    {
        try{
            return $this->entityManager->find($entityName, $id, $lockMode, $lockVersion);
        } catch(ORMException $e) {
            if (!$this->entityManager->isOpen()) {
                $this->resetEntityManager();
            }
            throw $e;
        }
    }
public function find ( $ entityName , $ id , $ lockMode = null , $ lockVersion = null ) { try { return $ this -> entityManager -> find ( $ entityName , $ id , $ lockMode , $ lockVersion ) ; } catch ( ORMException $ e ) { if ( ! $ this -> entityManager -> isOpen ( ) ) { $ this -> resetEntityManager ( ) ; } throw $ e ; } }
Finds an Entity by its identifier.

@param string       $entityName  The class name of the entity to find.
@param mixed        $id          The identity of the entity to find.
@param integer|null $lockMode    One of the \Doctrine\DBAL\LockMode::* constants
or NULL if no specific lock mode should be used
during the search.
@param integer|null $lockVersion The version of the entity to find when using
optimistic locking.

@return object|null The entity instance or NULL if the entity can not be found.

@throws OptimisticLockException
@throws ORMInvalidArgumentException
@throws TransactionRequiredException
@throws ORMException
Finds an Entity by its identifier .