@@ -173,7 +173,7 @@ |
||
| 173 | 173 | /** |
| 174 | 174 | * Returns the basket object for the given ID |
| 175 | 175 | * |
| 176 | - * @param string $baseId Unique order base ID |
|
| 176 | + * @param string $basketId Unique order base ID |
|
| 177 | 177 | * @return \Aimeos\MShop\Order\Item\Base\Iface Basket object including only the services |
| 178 | 178 | * @throws \Aimeos\Client\JsonApi\Exception If basket ID is not the same as stored before in the current session |
| 179 | 179 | */ |
@@ -43,8 +43,7 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | $view->items = $cntl->getItem( $id ); |
| 45 | 45 | $view->total = 1; |
| 46 | - } |
|
| 47 | - else |
|
| 46 | + } else |
|
| 48 | 47 | { |
| 49 | 48 | $total = 0; |
| 50 | 49 | $filter = $cntl->createFilter(); |
@@ -55,24 +54,21 @@ discard block |
||
| 55 | 54 | } |
| 56 | 55 | |
| 57 | 56 | $status = 200; |
| 58 | - } |
|
| 59 | - catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 57 | + } catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 60 | 58 | { |
| 61 | 59 | $status = 403; |
| 62 | 60 | $view->errors = array( array( |
| 63 | 61 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 64 | 62 | 'detail' => $e->getTraceAsString(), |
| 65 | 63 | ) ); |
| 66 | - } |
|
| 67 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 64 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 68 | 65 | { |
| 69 | 66 | $status = 404; |
| 70 | 67 | $view->errors = array( array( |
| 71 | 68 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 72 | 69 | 'detail' => $e->getTraceAsString(), |
| 73 | 70 | ) ); |
| 74 | - } |
|
| 75 | - catch( \Exception $e ) |
|
| 71 | + } catch( \Exception $e ) |
|
| 76 | 72 | { |
| 77 | 73 | $status = 500; |
| 78 | 74 | $view->errors = array( array( |
@@ -116,32 +112,28 @@ discard block |
||
| 116 | 112 | $view->total = 1; |
| 117 | 113 | |
| 118 | 114 | $status = 201; |
| 119 | - } |
|
| 120 | - catch( \Aimeos\Client\JsonApi\Exception $e ) |
|
| 115 | + } catch( \Aimeos\Client\JsonApi\Exception $e ) |
|
| 121 | 116 | { |
| 122 | 117 | $status = $e->getCode(); |
| 123 | 118 | $view->errors = array( array( |
| 124 | 119 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 125 | 120 | 'detail' => $e->getTraceAsString(), |
| 126 | 121 | ) ); |
| 127 | - } |
|
| 128 | - catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 122 | + } catch( \Aimeos\Controller\Frontend\Exception $e ) |
|
| 129 | 123 | { |
| 130 | 124 | $status = 403; |
| 131 | 125 | $view->errors = array( array( |
| 132 | 126 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 133 | 127 | 'detail' => $e->getTraceAsString(), |
| 134 | 128 | ) ); |
| 135 | - } |
|
| 136 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 129 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 137 | 130 | { |
| 138 | 131 | $status = 404; |
| 139 | 132 | $view->errors = array( array( |
| 140 | 133 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 141 | 134 | 'detail' => $e->getTraceAsString(), |
| 142 | 135 | ) ); |
| 143 | - } |
|
| 144 | - catch( \Exception $e ) |
|
| 136 | + } catch( \Exception $e ) |
|
| 145 | 137 | { |
| 146 | 138 | $status = 500; |
| 147 | 139 | $view->errors = array( array( |
@@ -313,6 +313,9 @@ |
||
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | |
| 316 | + /** |
|
| 317 | + * @param string $name |
|
| 318 | + */ |
|
| 316 | 319 | protected function access( $name ) |
| 317 | 320 | { |
| 318 | 321 | $class = new \ReflectionClass( '\Aimeos\Client\JsonApi\Order\Standard' ); |
@@ -268,7 +268,7 @@ |
||
| 268 | 268 | $baseManager = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' ); |
| 269 | 269 | |
| 270 | 270 | $search = $baseManager->createSearch(); |
| 271 | - $search->setConditions( $search->compare( '==', 'order.base.price', '672.00') ); |
|
| 271 | + $search->setConditions( $search->compare( '==', 'order.base.price', '672.00' ) ); |
|
| 272 | 272 | |
| 273 | 273 | $items = $baseManager->searchItems( $search ); |
| 274 | 274 | |
@@ -101,8 +101,7 @@ |
||
| 101 | 101 | foreach( $items as $item ) { |
| 102 | 102 | $data[] = $entryFcn( $item ); |
| 103 | 103 | } |
| 104 | - } |
|
| 105 | - else |
|
| 104 | + } else |
|
| 106 | 105 | { |
| 107 | 106 | $data = $entryFcn( $items ); |
| 108 | 107 | } |
@@ -59,16 +59,14 @@ discard block |
||
| 59 | 59 | $status = 200; |
| 60 | 60 | $type = $view->param( 'id', 'default' ); |
| 61 | 61 | $view->item = $this->controller->setType( $type )->clear()->get(); |
| 62 | - } |
|
| 63 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 62 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 64 | 63 | { |
| 65 | 64 | $status = 404; |
| 66 | 65 | $view->errors = array( array( |
| 67 | 66 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 68 | 67 | 'detail' => $e->getTraceAsString(), |
| 69 | 68 | ) ); |
| 70 | - } |
|
| 71 | - catch( \Exception $e ) |
|
| 69 | + } catch( \Exception $e ) |
|
| 72 | 70 | { |
| 73 | 71 | $status = 500; |
| 74 | 72 | $view->errors = array( array( |
@@ -99,24 +97,21 @@ discard block |
||
| 99 | 97 | try |
| 100 | 98 | { |
| 101 | 99 | $view->item = $this->controller->load( $id, $this->getParts( $view ) ); |
| 102 | - } |
|
| 103 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 100 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 104 | 101 | { |
| 105 | 102 | $view->item = $this->controller->setType( $id )->get(); |
| 106 | 103 | $allow = true; |
| 107 | 104 | } |
| 108 | 105 | |
| 109 | 106 | $status = 200; |
| 110 | - } |
|
| 111 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 107 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 112 | 108 | { |
| 113 | 109 | $status = 404; |
| 114 | 110 | $view->errors = array( array( |
| 115 | 111 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 116 | 112 | 'detail' => $e->getTraceAsString(), |
| 117 | 113 | ) ); |
| 118 | - } |
|
| 119 | - catch( \Exception $e ) |
|
| 114 | + } catch( \Exception $e ) |
|
| 120 | 115 | { |
| 121 | 116 | $status = 500; |
| 122 | 117 | $view->errors = array( array( |
@@ -153,16 +148,14 @@ discard block |
||
| 153 | 148 | |
| 154 | 149 | $view->item = $basket; |
| 155 | 150 | $status = 200; |
| 156 | - } |
|
| 157 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 151 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 158 | 152 | { |
| 159 | 153 | $status = 404; |
| 160 | 154 | $view->errors = array( array( |
| 161 | 155 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 162 | 156 | 'detail' => $e->getTraceAsString(), |
| 163 | 157 | ) ); |
| 164 | - } |
|
| 165 | - catch( \Exception $e ) |
|
| 158 | + } catch( \Exception $e ) |
|
| 166 | 159 | { |
| 167 | 160 | $status = 500; |
| 168 | 161 | $view->errors = array( array( |
@@ -193,16 +186,14 @@ discard block |
||
| 193 | 186 | |
| 194 | 187 | $view->item = $item; |
| 195 | 188 | $status = 200; |
| 196 | - } |
|
| 197 | - catch( \Aimeos\MShop\Exception $e ) |
|
| 189 | + } catch( \Aimeos\MShop\Exception $e ) |
|
| 198 | 190 | { |
| 199 | 191 | $status = 404; |
| 200 | 192 | $view->errors = array( array( |
| 201 | 193 | 'title' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ), |
| 202 | 194 | 'detail' => $e->getTraceAsString(), |
| 203 | 195 | ) ); |
| 204 | - } |
|
| 205 | - catch( \Exception $e ) |
|
| 196 | + } catch( \Exception $e ) |
|
| 206 | 197 | { |
| 207 | 198 | $status = 500; |
| 208 | 199 | $view->errors = array( array( |