private static function hasPDOException(\Exception $exception)
    {
        if ($exception instanceof \PDOException) {
            return true;
        }
        if ($exception->getPrevious() === null) {
            return false;
        }
        return self::hasPDOException($exception->getPrevious());
    }
private static function hasPDOException(\Exception $exception)
    {
        if ($exception instanceof \PDOException) {
            return true;
        }
        if ($exception->getPrevious() === null) {
            return false;
        }
        return self::hasPDOException($exception->getPrevious());
    }
private static function hasPDOException ( \ Exception $ exception ) { if ( $ exception instanceof \ PDOException ) { return true ; } if ( $ exception -> getPrevious ( ) === null ) { return false ; } return self :: hasPDOException ( $ exception -> getPrevious ( ) ) ; }
Checks if an exception or any of its previous exceptions is a PDOException.

@param \Exception $exception The exception.
@return boolean True if there's a PDOException.
Checks if an exception or any of its previous exceptions is a PDOException .