@@ -25,8 +25,7 @@ discard block |
||
25 | 25 | } |
26 | 26 | |
27 | 27 | |
28 | -$entryFcn = function( \Aimeos\MShop\Customer\Item\Address\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) |
|
29 | -{ |
|
28 | +$entryFcn = function( \Aimeos\MShop\Customer\Item\Address\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) { |
|
30 | 29 | $id = $item->getId(); |
31 | 30 | $attributes = $item->toArray(); |
32 | 31 | $type = $item->getResourceType(); |
@@ -92,8 +91,7 @@ discard block |
||
92 | 91 | foreach( $items as $addrItem ) { |
93 | 92 | $data[] = $entryFcn( $addrItem ); |
94 | 93 | } |
95 | - } |
|
96 | - else |
|
94 | + } else |
|
97 | 95 | { |
98 | 96 | $data = $entryFcn( $items ); |
99 | 97 | } |
@@ -24,8 +24,7 @@ discard block |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | |
27 | -$entryFcn = function( \Aimeos\MShop\Subscription\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) |
|
28 | -{ |
|
27 | +$entryFcn = function( \Aimeos\MShop\Subscription\Item\Iface $item ) use ( $fields, $target, $cntl, $action, $config ) { |
|
29 | 28 | $id = $item->getId(); |
30 | 29 | $attributes = $item->toArray(); |
31 | 30 | $type = $item->getResourceType(); |
@@ -85,8 +84,7 @@ discard block |
||
85 | 84 | foreach( $items as $item ) { |
86 | 85 | $data[] = $entryFcn( $item ); |
87 | 86 | } |
88 | - } |
|
89 | - else |
|
87 | + } else |
|
90 | 88 | { |
91 | 89 | $data = $entryFcn( $items ); |
92 | 90 | } |
@@ -36,8 +36,11 @@ |
||
36 | 36 | <?php if( isset( $this->errors ) ) : ?> |
37 | 37 | "errors": <?= json_encode( $this->errors, JSON_PRETTY_PRINT ); ?> |
38 | 38 | |
39 | - <?php else : ?> |
|
40 | - "data": <?= json_encode( $entries ); ?> |
|
39 | + <?php else { |
|
40 | + : ?> |
|
41 | + "data": <?= json_encode( $entries ); |
|
42 | +} |
|
43 | +?> |
|
41 | 44 | |
42 | 45 | <?php endif; ?> |
43 | 46 | } |
@@ -63,8 +63,7 @@ discard block |
||
63 | 63 | } |
64 | 64 | |
65 | 65 | $cntl->store(); |
66 | - } |
|
67 | - else |
|
66 | + } else |
|
68 | 67 | { |
69 | 68 | if( isset( $items[$relId] ) ) { |
70 | 69 | $cntl->deleteAddressItem( $items[$relId] )->store(); |
@@ -113,8 +112,7 @@ discard block |
||
113 | 112 | { |
114 | 113 | $view->items = $item->getAddressItems(); |
115 | 114 | $view->total = count( $view->items ); |
116 | - } |
|
117 | - else |
|
115 | + } else |
|
118 | 116 | { |
119 | 117 | $view->items = $item->getAddressItem( $relId ); |
120 | 118 | $view->total = empty( $view->items ) ? 0 : 1; |
@@ -58,8 +58,7 @@ |
||
58 | 58 | $view->items = $provider->getServiceItem(); |
59 | 59 | $view->total = 1; |
60 | 60 | } |
61 | - } |
|
62 | - else |
|
61 | + } else |
|
63 | 62 | { |
64 | 63 | $attributes = $prices = $items = []; |
65 | 64 | $cntl->type( $view->param( 'filter/cs_type' ) ); |
@@ -66,8 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | $cntl->store(); |
69 | - } |
|
70 | - else |
|
69 | + } else |
|
71 | 70 | { |
72 | 71 | if( isset( $items[$relId] ) ) { |
73 | 72 | $cntl->deleteListItem( $items[$relId]->getDomain(), $items[$relId] )->store(); |
@@ -119,8 +118,7 @@ discard block |
||
119 | 118 | { |
120 | 119 | $view->items = $items; |
121 | 120 | $view->total = count( $items ); |
122 | - } |
|
123 | - else |
|
121 | + } else |
|
124 | 122 | { |
125 | 123 | $view->items = isset( $items[$relId] ) ? $items[$relId] : null; |
126 | 124 | $view->total = empty( $view->items ) ? 0 : 1; |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | } |
27 | 27 | |
28 | 28 | |
29 | -$entryFcn = function( \Aimeos\MShop\Order\Item\Base\Iface $item, $basketId ) use ( $fields, $target, $cntl, $action, $config ) |
|
30 | -{ |
|
29 | +$entryFcn = function( \Aimeos\MShop\Order\Item\Base\Iface $item, $basketId ) use ( $fields, $target, $cntl, $action, $config ) { |
|
31 | 30 | $allow = array( 'GET' ); |
32 | 31 | $attributes = $item->toArray(); |
33 | 32 | $params = ['resource' => 'basket', 'id' => $basketId]; |
@@ -95,8 +94,7 @@ discard block |
||
95 | 94 | }; |
96 | 95 | |
97 | 96 | |
98 | -$productFcn = function( \Aimeos\MShop\Order\Item\Base\Iface $item, $basketId ) use ( $fields, $target, $cntl, $action, $config ) |
|
99 | -{ |
|
97 | +$productFcn = function( \Aimeos\MShop\Order\Item\Base\Iface $item, $basketId ) use ( $fields, $target, $cntl, $action, $config ) { |
|
100 | 98 | $products = []; |
101 | 99 | |
102 | 100 | foreach( $item->getProducts() as $position => $orderProduct ) |
@@ -137,8 +135,7 @@ discard block |
||
137 | 135 | }; |
138 | 136 | |
139 | 137 | |
140 | -$serviceFcn = function( \Aimeos\MShop\Order\Item\Base\Iface $item, $basketId ) use ( $fields, $target, $cntl, $action, $config ) |
|
141 | -{ |
|
138 | +$serviceFcn = function( \Aimeos\MShop\Order\Item\Base\Iface $item, $basketId ) use ( $fields, $target, $cntl, $action, $config ) { |
|
142 | 139 | $services = []; |
143 | 140 | |
144 | 141 | foreach( $item->getServices() as $type => $list ) |
@@ -171,8 +168,7 @@ discard block |
||
171 | 168 | }; |
172 | 169 | |
173 | 170 | |
174 | -$addressFcn = function( \Aimeos\MShop\Order\Item\Base\Iface $item, $basketId ) use ( $fields, $target, $cntl, $action, $config ) |
|
175 | -{ |
|
171 | +$addressFcn = function( \Aimeos\MShop\Order\Item\Base\Iface $item, $basketId ) use ( $fields, $target, $cntl, $action, $config ) { |
|
176 | 172 | $list = []; |
177 | 173 | |
178 | 174 | foreach( $item->getAddresses() as $type => $addresses ) |
@@ -201,8 +197,7 @@ discard block |
||
201 | 197 | }; |
202 | 198 | |
203 | 199 | |
204 | -$couponFcn = function( \Aimeos\MShop\Order\Item\Base\Iface $item, $basketId ) use ( $fields, $target, $cntl, $action, $config ) |
|
205 | -{ |
|
200 | +$couponFcn = function( \Aimeos\MShop\Order\Item\Base\Iface $item, $basketId ) use ( $fields, $target, $cntl, $action, $config ) { |
|
206 | 201 | $coupons = []; |
207 | 202 | |
208 | 203 | foreach( $item->getCoupons() as $code => $list ) |
@@ -268,10 +263,13 @@ discard block |
||
268 | 263 | "href": "<?= $this->url( $target, $cntl, $action, ['resource' => 'basket', 'id' => $basketId, 'related' => 'coupon'], [], $config ); ?>", |
269 | 264 | "allow": ["POST"] |
270 | 265 | } |
271 | - <?php else : ?> |
|
266 | + <?php else { |
|
267 | + : ?> |
|
272 | 268 | , |
273 | 269 | "order": { |
274 | - "href": "<?= $this->url( $target, $cntl, $action, ['resource' => 'order'], [], $config ); ?>", |
|
270 | + "href": "<?= $this->url( $target, $cntl, $action, ['resource' => 'order'], [], $config ); |
|
271 | +} |
|
272 | +?>", |
|
275 | 273 | "allow": ["POST"] |
276 | 274 | } |
277 | 275 | <?php endif; ?> |
@@ -43,8 +43,7 @@ |
||
43 | 43 | { |
44 | 44 | $view->items = $cntl->get( $id ); |
45 | 45 | $view->total = 1; |
46 | - } |
|
47 | - else |
|
46 | + } else |
|
48 | 47 | { |
49 | 48 | $total = 0; |
50 | 49 | $items = $cntl->parse( (array) $view->param( 'filter', [] ) ) |
@@ -63,8 +63,7 @@ discard block |
||
63 | 63 | } |
64 | 64 | |
65 | 65 | $cntl->store(); |
66 | - } |
|
67 | - else |
|
66 | + } else |
|
68 | 67 | { |
69 | 68 | if( isset( $items[$relId] ) ) { |
70 | 69 | $cntl->deletePropertyItem( $items[$relId] )->store(); |
@@ -113,8 +112,7 @@ discard block |
||
113 | 112 | { |
114 | 113 | $view->items = $items; |
115 | 114 | $view->total = count( $items ); |
116 | - } |
|
117 | - else |
|
115 | + } else |
|
118 | 116 | { |
119 | 117 | $view->items = isset( $items[$relId] ) ? $items[$relId] : null; |
120 | 118 | $view->total = empty( $view->items ) ? 0 : 1; |