@@ -69,9 +69,12 @@ |
||
| 69 | 69 | */ |
| 70 | 70 | public function execute() : \Aimeos\MW\DB\Result\Iface |
| 71 | 71 | { |
| 72 | - try { |
|
| 72 | + try |
|
| 73 | + { |
|
| 73 | 74 | $result = $this->getConnection()->getRawObject()->getWrappedConnection()->query( $this->sql ); |
| 74 | - } catch( \Doctrine\DBAL\Driver\Exception $e ) { |
|
| 75 | + } |
|
| 76 | + catch( \Doctrine\DBAL\Driver\Exception $e ) |
|
| 77 | + { |
|
| 75 | 78 | throw new \Aimeos\MW\DB\Exception( $e->getMessage() . ': ' . $this->sql, $e->getCode() ); |
| 76 | 79 | } |
| 77 | 80 | |
@@ -71,9 +71,12 @@ |
||
| 71 | 71 | */ |
| 72 | 72 | public function execute() : \Aimeos\MW\DB\Result\Iface |
| 73 | 73 | { |
| 74 | - try { |
|
| 74 | + try |
|
| 75 | + { |
|
| 75 | 76 | $result = $this->exec(); |
| 76 | - } catch( \Doctrine\DBAL\Driver\Exception $e ) { |
|
| 77 | + } |
|
| 78 | + catch( \Doctrine\DBAL\Driver\Exception $e ) |
|
| 79 | + { |
|
| 77 | 80 | throw new \Aimeos\MW\DB\Exception( $e->getMessage() . ': ' . $this->sql . map( $this->binds )->col( 0 )->toJson(), $e->getCode() ); |
| 78 | 81 | } |
| 79 | 82 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | switch( $type ) |
| 118 | 118 | { |
| 119 | 119 | case \Aimeos\MW\DB\Statement\Base::PARAM_NULL: |
| 120 | - $dbaltype = \Doctrine\DBAL\ParameterType::NULL; break; |
|
| 120 | + $dbaltype = \Doctrine\DBAL\ParameterType::null; break; |
|
| 121 | 121 | case \Aimeos\MW\DB\Statement\Base::PARAM_BOOL: |
| 122 | 122 | $dbaltype = \Doctrine\DBAL\ParameterType::BOOLEAN; break; |
| 123 | 123 | case \Aimeos\MW\DB\Statement\Base::PARAM_INT: |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | if( is_null( $value ) ) { |
| 136 | - $dbaltype = \Doctrine\DBAL\ParameterType::NULL; |
|
| 136 | + $dbaltype = \Doctrine\DBAL\ParameterType::null; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | return $dbaltype; |
@@ -50,9 +50,12 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function affectedRows() : int |
| 52 | 52 | { |
| 53 | - try { |
|
| 53 | + try |
|
| 54 | + { |
|
| 54 | 55 | return $this->result->rowCount(); |
| 55 | - } catch( \Doctrine\DBAL\Driver\Exception $e ) { |
|
| 56 | + } |
|
| 57 | + catch( \Doctrine\DBAL\Driver\Exception $e ) |
|
| 58 | + { |
|
| 56 | 59 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
| 57 | 60 | } |
| 58 | 61 | } |
@@ -90,9 +93,12 @@ discard block |
||
| 90 | 93 | */ |
| 91 | 94 | public function finish() : Iface |
| 92 | 95 | { |
| 93 | - try { |
|
| 96 | + try |
|
| 97 | + { |
|
| 94 | 98 | $this->result->free(); |
| 95 | - } catch( \Doctrine\DBAL\Driver\Exception $e ) { |
|
| 99 | + } |
|
| 100 | + catch( \Doctrine\DBAL\Driver\Exception $e ) |
|
| 101 | + { |
|
| 96 | 102 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
| 97 | 103 | } |
| 98 | 104 | |