Doctrine\DBAL\DBALException::driverException PHP Method

driverException() public static method

public static driverException ( Doctrine\DBAL\Driver $driver, Exception $driverEx ) : DBALException
$driver Doctrine\DBAL\Driver
$driverEx Exception
return DBALException
    public static function driverException(Driver $driver, \Exception $driverEx)
    {
        return static::wrapException($driver, $driverEx, "An exception occurred in driver: " . $driverEx->getMessage());
    }

Usage Example

Esempio n. 1
2
 /**
  * {@inheritdoc}
  */
 public function connect(array $params, $username = null, $password = null, array $driverOptions = array())
 {
     try {
         $pdo = new PDOConnection($this->_constructPdoDsn($params), $username, $password, $driverOptions);
         if (PHP_VERSION_ID >= 50600 && (!isset($driverOptions[PDO::PGSQL_ATTR_DISABLE_PREPARES]) || true === $driverOptions[PDO::PGSQL_ATTR_DISABLE_PREPARES])) {
             $pdo->setAttribute(PDO::PGSQL_ATTR_DISABLE_PREPARES, true);
         }
         return $pdo;
     } catch (PDOException $e) {
         throw DBALException::driverException($this, $e);
     }
 }
All Usage Examples Of Doctrine\DBAL\DBALException::driverException