public function getRepository($entityName)
    {
        try{
            return $this->entityManager->getRepository($entityName);
        } catch(ORMException $e) {
            if (!$this->entityManager->isOpen()) {
                $this->resetEntityManager();
            }
            throw $e;
        }
    }
public function getRepository($entityName)
    {
        try{
            return $this->entityManager->getRepository($entityName);
        } catch(ORMException $e) {
            if (!$this->entityManager->isOpen()) {
                $this->resetEntityManager();
            }
            throw $e;
        }
    }
public function getRepository ( $ entityName ) { try { return $ this -> entityManager -> getRepository ( $ entityName ) ; } catch ( ORMException $ e ) { if ( ! $ this -> entityManager -> isOpen ( ) ) { $ this -> resetEntityManager ( ) ; } throw $ e ; } }
Gets the repository for an entity class.

@param string $entityName The name of the entity.

@return \Doctrine\ORM\EntityRepository The repository class.
Gets the repository for an entity class .