private function setEntityManager()
    {
        try {
            if ($this->_instance_options['em'] instanceof EntityManager) {
                $this->_em = $this->_instance_options['em'];
            } else {
                $this->_em = EntityManagerCreator::create($this->_instance_options['dbal'], $this->getLogger());
            }
        } catch (InvalidArgumentException $e) {
            throw new CacheException('DAO cache: enable to create a database conneciton', CacheException::INVALID_DB_CONNECTION, $e);
        }

        return $this;
    }
private function setEntityManager()
    {
        try {
            if ($this->_instance_options['em'] instanceof EntityManager) {
                $this->_em = $this->_instance_options['em'];
            } else {
                $this->_em = EntityManagerCreator::create($this->_instance_options['dbal'], $this->getLogger());
            }
        } catch (InvalidArgumentException $e) {
            throw new CacheException('DAO cache: enable to create a database conneciton', CacheException::INVALID_DB_CONNECTION, $e);
        }

        return $this;
    }
private function setEntityManager ( ) { try { if ( $ this -> _instance_options [ 'em' ] instanceof EntityManager ) { $ this -> _em = $ this -> _instance_options [ 'em' ] ; } else { $ this -> _em = EntityManagerCreator :: create ( $ this -> _instance_options [ 'dbal' ] , $ this -> getLogger ( ) ) ; } } catch ( InvalidArgumentException $ e ) { throw new CacheException ( 'DAO cache: enable to create a database conneciton' , CacheException :: INVALID_DB_CONNECTION , $ e ) ; } return $ this ; }
Sets the entity manager.

@return \BackBee\Cache\DAO\Cache

@throws \BackBee\Cache\Exception\CacheException Occurs if if enable to create a database connection.
Sets the entity manager .