Doctrine\DBAL\DBALException::driverExceptionDuringQuery PHP Method

driverExceptionDuringQuery() public static method

public static driverExceptionDuringQuery ( Doctrine\DBAL\Driver $driver, Exception $driverEx, string $sql, array $params = [] ) : DBALException
$driver Doctrine\DBAL\Driver
$driverEx Exception
$sql string
$params array
return DBALException
    public static function driverExceptionDuringQuery(Driver $driver, \Exception $driverEx, $sql, array $params = array())
    {
        $msg = "An exception occurred while executing '" . $sql . "'";
        if ($params) {
            $msg .= " with params " . self::formatParameters($params);
        }
        $msg .= ":\n\n" . $driverEx->getMessage();
        return static::wrapException($driver, $driverEx, $msg);
    }

Usage Example

Ejemplo n.º 1
1
 /**
  * @return array
  */
 public function validateDataProvider()
 {
     return [[$this->getDataSourceInterfaceMock(), false, DBALException::driverExceptionDuringQuery(new \Exception('failed'), 'sql')], [$this->getDataSourceInterfaceMock(), false, new InvalidConfigurationException()], [$this->getDataSourceInterfaceMock(), false, null], [$this->getOrmDataSourceInterfaceMock(), true, DBALException::driverExceptionDuringQuery(new \Exception('failed'), 'sql')], [$this->getOrmDataSourceInterfaceMock(), true, new InvalidConfigurationException()], [$this->getOrmDataSourceInterfaceMock(), true, null]];
 }
All Usage Examples Of Doctrine\DBAL\DBALException::driverExceptionDuringQuery