@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Group; |
12 | 12 | |
13 | -sprintf( 'group' ); // for translation |
|
13 | +sprintf('group'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -35,37 +35,37 @@ discard block |
||
35 | 35 | |
36 | 36 | try |
37 | 37 | { |
38 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
39 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
38 | + if (($id = $view->param('id')) === null) { |
|
39 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
40 | 40 | } |
41 | 41 | |
42 | - $manager = \Aimeos\MShop::create( $context, 'customer/group' ); |
|
43 | - $view->item = $manager->getItem( $id ); |
|
42 | + $manager = \Aimeos\MShop::create($context, 'customer/group'); |
|
43 | + $view->item = $manager->getItem($id); |
|
44 | 44 | |
45 | - $view->itemData = $this->toArray( $view->item, true ); |
|
45 | + $view->itemData = $this->toArray($view->item, true); |
|
46 | 46 | $view->itemSubparts = $this->getSubClientNames(); |
47 | 47 | $view->itemBody = ''; |
48 | 48 | |
49 | - foreach( $this->getSubClients() as $idx => $client ) |
|
49 | + foreach ($this->getSubClients() as $idx => $client) |
|
50 | 50 | { |
51 | 51 | $view->tabindex = ++$idx + 1; |
52 | 52 | $view->itemBody .= $client->copy(); |
53 | 53 | } |
54 | 54 | } |
55 | - catch( \Aimeos\MShop\Exception $e ) |
|
55 | + catch (\Aimeos\MShop\Exception $e) |
|
56 | 56 | { |
57 | - $error = array( 'group-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
58 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
59 | - $this->logException( $e ); |
|
57 | + $error = array('group-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
58 | + $view->errors = $view->get('errors', []) + $error; |
|
59 | + $this->logException($e); |
|
60 | 60 | } |
61 | - catch( \Exception $e ) |
|
61 | + catch (\Exception $e) |
|
62 | 62 | { |
63 | - $error = array( 'group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
64 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
65 | - $this->logException( $e ); |
|
63 | + $error = array('group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
64 | + $view->errors = $view->get('errors', []) + $error; |
|
65 | + $this->logException($e); |
|
66 | 66 | } |
67 | 67 | |
68 | - return $this->render( $view ); |
|
68 | + return $this->render($view); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | |
82 | 82 | try |
83 | 83 | { |
84 | - $data = $view->param( 'item', [] ); |
|
84 | + $data = $view->param('item', []); |
|
85 | 85 | |
86 | - if( !isset( $view->item ) ) { |
|
87 | - $view->item = \Aimeos\MShop::create( $context, 'customer/group' )->createItem(); |
|
86 | + if (!isset($view->item)) { |
|
87 | + $view->item = \Aimeos\MShop::create($context, 'customer/group')->createItem(); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $data['customer.group.siteid'] = $view->item->getSiteId(); |
@@ -93,26 +93,26 @@ discard block |
||
93 | 93 | $view->itemData = $data; |
94 | 94 | $view->itemBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $idx => $client ) |
|
96 | + foreach ($this->getSubClients() as $idx => $client) |
|
97 | 97 | { |
98 | 98 | $view->tabindex = ++$idx + 1; |
99 | 99 | $view->itemBody .= $client->create(); |
100 | 100 | } |
101 | 101 | } |
102 | - catch( \Aimeos\MShop\Exception $e ) |
|
102 | + catch (\Aimeos\MShop\Exception $e) |
|
103 | 103 | { |
104 | - $error = array( 'group-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
105 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
106 | - $this->logException( $e ); |
|
104 | + $error = array('group-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
105 | + $view->errors = $view->get('errors', []) + $error; |
|
106 | + $this->logException($e); |
|
107 | 107 | } |
108 | - catch( \Exception $e ) |
|
108 | + catch (\Exception $e) |
|
109 | 109 | { |
110 | - $error = array( 'group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
111 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
112 | - $this->logException( $e ); |
|
110 | + $error = array('group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
111 | + $view->errors = $view->get('errors', []) + $error; |
|
112 | + $this->logException($e); |
|
113 | 113 | } |
114 | 114 | |
115 | - return $this->render( $view ); |
|
115 | + return $this->render($view); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | |
@@ -126,38 +126,38 @@ discard block |
||
126 | 126 | $view = $this->getView(); |
127 | 127 | $context = $this->getContext(); |
128 | 128 | |
129 | - $manager = \Aimeos\MShop::create( $context, 'customer/group' ); |
|
129 | + $manager = \Aimeos\MShop::create($context, 'customer/group'); |
|
130 | 130 | $manager->begin(); |
131 | 131 | |
132 | 132 | try |
133 | 133 | { |
134 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
135 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
134 | + if (($id = $view->param('id')) === null) { |
|
135 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
136 | 136 | } |
137 | 137 | |
138 | - $view->item = $manager->getItem( $id ); |
|
138 | + $view->item = $manager->getItem($id); |
|
139 | 139 | |
140 | - foreach( $this->getSubClients() as $client ) { |
|
140 | + foreach ($this->getSubClients() as $client) { |
|
141 | 141 | $client->delete(); |
142 | 142 | } |
143 | 143 | |
144 | - $manager->deleteItem( $id ); |
|
144 | + $manager->deleteItem($id); |
|
145 | 145 | $manager->commit(); |
146 | 146 | |
147 | - $this->nextAction( $view, 'search', 'group', null, 'delete' ); |
|
147 | + $this->nextAction($view, 'search', 'group', null, 'delete'); |
|
148 | 148 | return; |
149 | 149 | } |
150 | - catch( \Aimeos\MShop\Exception $e ) |
|
150 | + catch (\Aimeos\MShop\Exception $e) |
|
151 | 151 | { |
152 | - $error = array( 'group-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
153 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
154 | - $this->logException( $e ); |
|
152 | + $error = array('group-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
153 | + $view->errors = $view->get('errors', []) + $error; |
|
154 | + $this->logException($e); |
|
155 | 155 | } |
156 | - catch( \Exception $e ) |
|
156 | + catch (\Exception $e) |
|
157 | 157 | { |
158 | - $error = array( 'group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
159 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
160 | - $this->logException( $e ); |
|
158 | + $error = array('group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
159 | + $view->errors = $view->get('errors', []) + $error; |
|
160 | + $this->logException($e); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | $manager->rollback(); |
@@ -178,37 +178,37 @@ discard block |
||
178 | 178 | |
179 | 179 | try |
180 | 180 | { |
181 | - if( ( $id = $view->param( 'id' ) ) === null ) { |
|
182 | - throw new \Aimeos\Admin\JQAdm\Exception( sprintf( 'Required parameter "%1$s" is missing', 'id' ) ); |
|
181 | + if (($id = $view->param('id')) === null) { |
|
182 | + throw new \Aimeos\Admin\JQAdm\Exception(sprintf('Required parameter "%1$s" is missing', 'id')); |
|
183 | 183 | } |
184 | 184 | |
185 | - $manager = \Aimeos\MShop::create( $context, 'customer/group' ); |
|
185 | + $manager = \Aimeos\MShop::create($context, 'customer/group'); |
|
186 | 186 | |
187 | - $view->item = $manager->getItem( $id ); |
|
187 | + $view->item = $manager->getItem($id); |
|
188 | 188 | $view->itemSubparts = $this->getSubClientNames(); |
189 | - $view->itemData = $this->toArray( $view->item ); |
|
189 | + $view->itemData = $this->toArray($view->item); |
|
190 | 190 | $view->itemBody = ''; |
191 | 191 | |
192 | - foreach( $this->getSubClients() as $idx => $client ) |
|
192 | + foreach ($this->getSubClients() as $idx => $client) |
|
193 | 193 | { |
194 | 194 | $view->tabindex = ++$idx + 1; |
195 | 195 | $view->itemBody .= $client->get(); |
196 | 196 | } |
197 | 197 | } |
198 | - catch( \Aimeos\MShop\Exception $e ) |
|
198 | + catch (\Aimeos\MShop\Exception $e) |
|
199 | 199 | { |
200 | - $error = array( 'group-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
201 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
202 | - $this->logException( $e ); |
|
200 | + $error = array('group-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
201 | + $view->errors = $view->get('errors', []) + $error; |
|
202 | + $this->logException($e); |
|
203 | 203 | } |
204 | - catch( \Exception $e ) |
|
204 | + catch (\Exception $e) |
|
205 | 205 | { |
206 | - $error = array( 'group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
207 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
208 | - $this->logException( $e ); |
|
206 | + $error = array('group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
207 | + $view->errors = $view->get('errors', []) + $error; |
|
208 | + $this->logException($e); |
|
209 | 209 | } |
210 | 210 | |
211 | - return $this->render( $view ); |
|
211 | + return $this->render($view); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | |
@@ -222,40 +222,40 @@ discard block |
||
222 | 222 | $view = $this->getView(); |
223 | 223 | $context = $this->getContext(); |
224 | 224 | |
225 | - $manager = \Aimeos\MShop::create( $context, 'customer/group' ); |
|
225 | + $manager = \Aimeos\MShop::create($context, 'customer/group'); |
|
226 | 226 | $manager->begin(); |
227 | 227 | |
228 | 228 | try |
229 | 229 | { |
230 | - $item = $this->fromArray( $view->param( 'item', [] ) ); |
|
231 | - $view->item = $item->getId() ? $item : $manager->saveItem( $item ); |
|
230 | + $item = $this->fromArray($view->param('item', [])); |
|
231 | + $view->item = $item->getId() ? $item : $manager->saveItem($item); |
|
232 | 232 | $view->itemBody = ''; |
233 | 233 | |
234 | - foreach( $this->getSubClients() as $client ) { |
|
234 | + foreach ($this->getSubClients() as $client) { |
|
235 | 235 | $view->itemBody .= $client->save(); |
236 | 236 | } |
237 | 237 | |
238 | - $manager->saveItem( clone $view->item ); |
|
238 | + $manager->saveItem(clone $view->item); |
|
239 | 239 | $manager->commit(); |
240 | 240 | |
241 | - $this->nextAction( $view, $view->param( 'next' ), 'group', $view->item->getId(), 'save' ); |
|
241 | + $this->nextAction($view, $view->param('next'), 'group', $view->item->getId(), 'save'); |
|
242 | 242 | return; |
243 | 243 | } |
244 | - catch( \Aimeos\Admin\JQAdm\Exception $e ) |
|
244 | + catch (\Aimeos\Admin\JQAdm\Exception $e) |
|
245 | 245 | { |
246 | 246 | // fall through to create |
247 | 247 | } |
248 | - catch( \Aimeos\MShop\Exception $e ) |
|
248 | + catch (\Aimeos\MShop\Exception $e) |
|
249 | 249 | { |
250 | - $error = array( 'group-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
251 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
252 | - $this->logException( $e ); |
|
250 | + $error = array('group-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
251 | + $view->errors = $view->get('errors', []) + $error; |
|
252 | + $this->logException($e); |
|
253 | 253 | } |
254 | - catch( \Exception $e ) |
|
254 | + catch (\Exception $e) |
|
255 | 255 | { |
256 | - $error = array( 'group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
257 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
258 | - $this->logException( $e ); |
|
256 | + $error = array('group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
257 | + $view->errors = $view->get('errors', []) + $error; |
|
258 | + $this->logException($e); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | $manager->rollback(); |
@@ -277,31 +277,31 @@ discard block |
||
277 | 277 | try |
278 | 278 | { |
279 | 279 | $total = 0; |
280 | - $params = $this->storeSearchParams( $view->param(), 'group' ); |
|
281 | - $manager = \Aimeos\MShop::create( $context, 'customer/group' ); |
|
282 | - $search = $this->initCriteria( $manager->createSearch(), $params ); |
|
280 | + $params = $this->storeSearchParams($view->param(), 'group'); |
|
281 | + $manager = \Aimeos\MShop::create($context, 'customer/group'); |
|
282 | + $search = $this->initCriteria($manager->createSearch(), $params); |
|
283 | 283 | |
284 | - $view->items = $manager->searchItems( $search, [], $total ); |
|
285 | - $view->filterAttributes = $manager->getSearchAttributes( true ); |
|
284 | + $view->items = $manager->searchItems($search, [], $total); |
|
285 | + $view->filterAttributes = $manager->getSearchAttributes(true); |
|
286 | 286 | $view->filterOperators = $search->getOperators(); |
287 | 287 | $view->total = $total; |
288 | 288 | $view->itemBody = ''; |
289 | 289 | |
290 | - foreach( $this->getSubClients() as $client ) { |
|
290 | + foreach ($this->getSubClients() as $client) { |
|
291 | 291 | $view->itemBody .= $client->search(); |
292 | 292 | } |
293 | 293 | } |
294 | - catch( \Aimeos\MShop\Exception $e ) |
|
294 | + catch (\Aimeos\MShop\Exception $e) |
|
295 | 295 | { |
296 | - $error = array( 'group-item' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
297 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
298 | - $this->logException( $e ); |
|
296 | + $error = array('group-item' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
297 | + $view->errors = $view->get('errors', []) + $error; |
|
298 | + $this->logException($e); |
|
299 | 299 | } |
300 | - catch( \Exception $e ) |
|
300 | + catch (\Exception $e) |
|
301 | 301 | { |
302 | - $error = array( 'group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
303 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
304 | - $this->logException( $e ); |
|
302 | + $error = array('group-item' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
303 | + $view->errors = $view->get('errors', []) + $error; |
|
304 | + $this->logException($e); |
|
305 | 305 | } |
306 | 306 | |
307 | 307 | /** admin/jqadm/group/template-list |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | $tplconf = 'admin/jqadm/group/template-list'; |
327 | 327 | $default = 'group/list-standard'; |
328 | 328 | |
329 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
329 | + return $view->render($view->config($tplconf, $default)); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | * @param string|null $name Name of the sub-client (Default if null) |
338 | 338 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
339 | 339 | */ |
340 | - public function getSubClient( $type, $name = null ) |
|
340 | + public function getSubClient($type, $name = null) |
|
341 | 341 | { |
342 | 342 | /** admin/jqadm/group/decorators/excludes |
343 | 343 | * Excludes decorators added by the "common" option from the group JQAdm client |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | * @see admin/jqadm/group/decorators/excludes |
413 | 413 | * @see admin/jqadm/group/decorators/global |
414 | 414 | */ |
415 | - return $this->createSubClient( 'group/' . $type, $name ); |
|
415 | + return $this->createSubClient('group/' . $type, $name); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | * @since 2018.07 |
457 | 457 | * @category Developer |
458 | 458 | */ |
459 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/group/standard/subparts', [] ); |
|
459 | + return $this->getContext()->getConfig()->get('admin/jqadm/group/standard/subparts', []); |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | |
@@ -467,17 +467,17 @@ discard block |
||
467 | 467 | * @param string[] Data array |
468 | 468 | * @return \Aimeos\MShop\Group\Item\Iface New group item object |
469 | 469 | */ |
470 | - protected function fromArray( array $data ) |
|
470 | + protected function fromArray(array $data) |
|
471 | 471 | { |
472 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'customer/group' ); |
|
472 | + $manager = \Aimeos\MShop::create($this->getContext(), 'customer/group'); |
|
473 | 473 | |
474 | - if( isset( $data['customer.group.id'] ) && $data['customer.group.id'] != '' ) { |
|
475 | - $item = $manager->getItem( $data['customer.group.id'] ); |
|
474 | + if (isset($data['customer.group.id']) && $data['customer.group.id'] != '') { |
|
475 | + $item = $manager->getItem($data['customer.group.id']); |
|
476 | 476 | } else { |
477 | 477 | $item = $manager->createItem(); |
478 | 478 | } |
479 | 479 | |
480 | - $item->fromArray( $data ); |
|
480 | + $item->fromArray($data); |
|
481 | 481 | |
482 | 482 | return $item; |
483 | 483 | } |
@@ -489,11 +489,11 @@ discard block |
||
489 | 489 | * @param \Aimeos\MShop\Customer\Item\Group\Iface $item Group item object |
490 | 490 | * @return string[] Multi-dimensional associative list of item data |
491 | 491 | */ |
492 | - protected function toArray( \Aimeos\MShop\Customer\Item\Group\Iface $item, $copy = false ) |
|
492 | + protected function toArray(\Aimeos\MShop\Customer\Item\Group\Iface $item, $copy = false) |
|
493 | 493 | { |
494 | - $data = $item->toArray( true ); |
|
494 | + $data = $item->toArray(true); |
|
495 | 495 | |
496 | - if( $copy === true ) |
|
496 | + if ($copy === true) |
|
497 | 497 | { |
498 | 498 | $data['customer.group.siteid'] = $this->getContext()->getLocale()->getSiteId(); |
499 | 499 | $data['customer.group.id'] = ''; |
@@ -509,7 +509,7 @@ discard block |
||
509 | 509 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
510 | 510 | * @return string HTML output |
511 | 511 | */ |
512 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
512 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
513 | 513 | { |
514 | 514 | /** admin/jqadm/group/template-item |
515 | 515 | * Relative path to the HTML body template for the group item. |
@@ -533,6 +533,6 @@ discard block |
||
533 | 533 | $tplconf = 'admin/jqadm/group/template-item'; |
534 | 534 | $default = 'group/item-standard'; |
535 | 535 | |
536 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
536 | + return $view->render($view->config($tplconf, $default)); |
|
537 | 537 | } |
538 | 538 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Order\Invoice; |
12 | 12 | |
13 | -sprintf( 'invoice' ); // for translation |
|
13 | +sprintf('invoice'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -69,31 +69,31 @@ discard block |
||
69 | 69 | try |
70 | 70 | { |
71 | 71 | $total = 0; |
72 | - $params = $this->storeSearchParams( $view->param( 'oi', [] ), 'orderinvoice' ); |
|
73 | - $orderItems = $this->getOrderItems( $view->item, $params, $total ); |
|
72 | + $params = $this->storeSearchParams($view->param('oi', []), 'orderinvoice'); |
|
73 | + $orderItems = $this->getOrderItems($view->item, $params, $total); |
|
74 | 74 | |
75 | - $view->invoiceData = $this->toArray( $orderItems ); |
|
75 | + $view->invoiceData = $this->toArray($orderItems); |
|
76 | 76 | $view->invoiceTotal = $total; |
77 | 77 | $view->invoiceBody = ''; |
78 | 78 | |
79 | - foreach( $this->getSubClients() as $client ) { |
|
79 | + foreach ($this->getSubClients() as $client) { |
|
80 | 80 | $view->invoiceBody .= $client->search(); |
81 | 81 | } |
82 | 82 | } |
83 | - catch( \Aimeos\MShop\Exception $e ) |
|
83 | + catch (\Aimeos\MShop\Exception $e) |
|
84 | 84 | { |
85 | - $error = array( 'order-item-invoice' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
86 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
87 | - $this->logException( $e ); |
|
85 | + $error = array('order-item-invoice' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
86 | + $view->errors = $view->get('errors', []) + $error; |
|
87 | + $this->logException($e); |
|
88 | 88 | } |
89 | - catch( \Exception $e ) |
|
89 | + catch (\Exception $e) |
|
90 | 90 | { |
91 | - $error = array( 'order-item-invoice' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
92 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
93 | - $this->logException( $e ); |
|
91 | + $error = array('order-item-invoice' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
92 | + $view->errors = $view->get('errors', []) + $error; |
|
93 | + $this->logException($e); |
|
94 | 94 | } |
95 | 95 | |
96 | - return $this->render( $view ); |
|
96 | + return $this->render($view); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | |
@@ -105,33 +105,33 @@ discard block |
||
105 | 105 | $view = $this->getView(); |
106 | 106 | $context = $this->getContext(); |
107 | 107 | |
108 | - $manager = \Aimeos\MShop::create( $context, 'order' ); |
|
108 | + $manager = \Aimeos\MShop::create($context, 'order'); |
|
109 | 109 | $manager->begin(); |
110 | 110 | |
111 | 111 | try |
112 | 112 | { |
113 | - $this->storeSearchParams( $view->param( 'oi', [] ), 'orderinvoice' ); |
|
114 | - $this->fromArray( $view->item, $view->param( 'invoice', [] ) ); |
|
113 | + $this->storeSearchParams($view->param('oi', []), 'orderinvoice'); |
|
114 | + $this->fromArray($view->item, $view->param('invoice', [])); |
|
115 | 115 | $view->invoiceBody = ''; |
116 | 116 | |
117 | - foreach( $this->getSubClients() as $client ) { |
|
117 | + foreach ($this->getSubClients() as $client) { |
|
118 | 118 | $view->invoiceBody .= $client->save(); |
119 | 119 | } |
120 | 120 | |
121 | 121 | $manager->commit(); |
122 | 122 | return; |
123 | 123 | } |
124 | - catch( \Aimeos\MShop\Exception $e ) |
|
124 | + catch (\Aimeos\MShop\Exception $e) |
|
125 | 125 | { |
126 | - $error = array( 'order-item-invoice' => $context->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
127 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
128 | - $this->logException( $e ); |
|
126 | + $error = array('order-item-invoice' => $context->getI18n()->dt('mshop', $e->getMessage())); |
|
127 | + $view->errors = $view->get('errors', []) + $error; |
|
128 | + $this->logException($e); |
|
129 | 129 | } |
130 | - catch( \Exception $e ) |
|
130 | + catch (\Exception $e) |
|
131 | 131 | { |
132 | - $error = array( 'order-item-invoice' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
133 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
134 | - $this->logException( $e ); |
|
132 | + $error = array('order-item-invoice' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
133 | + $view->errors = $view->get('errors', []) + $error; |
|
134 | + $this->logException($e); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | $manager->rollback(); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * @param string|null $name Name of the sub-client (Default if null) |
148 | 148 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
149 | 149 | */ |
150 | - public function getSubClient( $type, $name = null ) |
|
150 | + public function getSubClient($type, $name = null) |
|
151 | 151 | { |
152 | 152 | /** admin/jqadm/order/invoice/decorators/excludes |
153 | 153 | * Excludes decorators added by the "common" option from the order JQAdm client |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | * @see admin/jqadm/order/invoice/decorators/excludes |
223 | 223 | * @see admin/jqadm/order/invoice/decorators/global |
224 | 224 | */ |
225 | - return $this->createSubClient( 'order/invoice/' . $type, $name ); |
|
225 | + return $this->createSubClient('order/invoice/' . $type, $name); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | * @since 2017.07 |
267 | 267 | * @category Developer |
268 | 268 | */ |
269 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/order/invoice/standard/subparts', [] ); |
|
269 | + return $this->getContext()->getConfig()->get('admin/jqadm/order/invoice/standard/subparts', []); |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | |
@@ -278,21 +278,21 @@ discard block |
||
278 | 278 | * @param integer $total Value/result parameter that will contain the item total afterwards |
279 | 279 | * @return \Aimeos\MShop\Order\Item\Iface[] Associative list of order IDs as keys and items as values |
280 | 280 | */ |
281 | - protected function getOrderItems( \Aimeos\MShop\Order\Item\Base\Iface $order, array $params, &$total ) |
|
281 | + protected function getOrderItems(\Aimeos\MShop\Order\Item\Base\Iface $order, array $params, &$total) |
|
282 | 282 | { |
283 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'order' ); |
|
283 | + $manager = \Aimeos\MShop::create($this->getContext(), 'order'); |
|
284 | 284 | |
285 | 285 | $search = $manager->createSearch(); |
286 | - $search->setSortations( [$search->sort( '-', 'order.ctime' )] ); |
|
286 | + $search->setSortations([$search->sort('-', 'order.ctime')]); |
|
287 | 287 | |
288 | - $search = $this->initCriteria( $search, $params, 'orderinvoice' ); |
|
288 | + $search = $this->initCriteria($search, $params, 'orderinvoice'); |
|
289 | 289 | $expr = [ |
290 | - $search->compare( '==', 'order.baseid', $order->getId() ), |
|
290 | + $search->compare('==', 'order.baseid', $order->getId()), |
|
291 | 291 | $search->getConditions(), |
292 | 292 | ]; |
293 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
293 | + $search->setConditions($search->combine('&&', $expr)); |
|
294 | 294 | |
295 | - return $manager->searchItems( $search, [], $total ); |
|
295 | + return $manager->searchItems($search, [], $total); |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | |
@@ -302,52 +302,52 @@ discard block |
||
302 | 302 | * @param \Aimeos\MShop\Order\Item\Base\Iface $order Order base item object |
303 | 303 | * @param string[] $data Data array |
304 | 304 | */ |
305 | - protected function fromArray( \Aimeos\MShop\Order\Item\Base\Iface $order, array $data ) |
|
305 | + protected function fromArray(\Aimeos\MShop\Order\Item\Base\Iface $order, array $data) |
|
306 | 306 | { |
307 | - $invoiceIds = $this->getValue( $data, 'order.id', [] ); |
|
308 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'order' ); |
|
307 | + $invoiceIds = $this->getValue($data, 'order.id', []); |
|
308 | + $manager = \Aimeos\MShop::create($this->getContext(), 'order'); |
|
309 | 309 | |
310 | - $search = $manager->createSearch()->setSlice( 0, count( $invoiceIds ) ); |
|
311 | - $search->setConditions( $search->compare( '==', 'order.id', $invoiceIds ) ); |
|
310 | + $search = $manager->createSearch()->setSlice(0, count($invoiceIds)); |
|
311 | + $search->setConditions($search->compare('==', 'order.id', $invoiceIds)); |
|
312 | 312 | |
313 | - $items = $manager->searchItems( $search ); |
|
313 | + $items = $manager->searchItems($search); |
|
314 | 314 | |
315 | 315 | |
316 | - foreach( $invoiceIds as $idx => $id ) |
|
316 | + foreach ($invoiceIds as $idx => $id) |
|
317 | 317 | { |
318 | - if( !isset( $items[$id] ) ) { |
|
318 | + if (!isset($items[$id])) { |
|
319 | 319 | $item = $manager->createItem(); |
320 | 320 | } else { |
321 | 321 | $item = $items[$id]; |
322 | 322 | } |
323 | 323 | |
324 | - if( isset( $data['order.statusdelivery'][$idx] ) ) { |
|
325 | - $item->setDeliveryStatus( $data['order.statusdelivery'][$idx] ); |
|
324 | + if (isset($data['order.statusdelivery'][$idx])) { |
|
325 | + $item->setDeliveryStatus($data['order.statusdelivery'][$idx]); |
|
326 | 326 | } |
327 | 327 | |
328 | - if( isset( $data['order.statuspayment'][$idx] ) ) { |
|
329 | - $item->setPaymentStatus( $data['order.statuspayment'][$idx] ); |
|
328 | + if (isset($data['order.statuspayment'][$idx])) { |
|
329 | + $item->setPaymentStatus($data['order.statuspayment'][$idx]); |
|
330 | 330 | } |
331 | 331 | |
332 | - if( isset( $data['order.datedelivery'][$idx] ) ) { |
|
333 | - $item->setDateDelivery( $data['order.datedelivery'][$idx] ); |
|
332 | + if (isset($data['order.datedelivery'][$idx])) { |
|
333 | + $item->setDateDelivery($data['order.datedelivery'][$idx]); |
|
334 | 334 | } |
335 | 335 | |
336 | - if( isset( $data['order.datepayment'][$idx] ) ) { |
|
337 | - $item->setDatePayment( $data['order.datepayment'][$idx] ); |
|
336 | + if (isset($data['order.datepayment'][$idx])) { |
|
337 | + $item->setDatePayment($data['order.datepayment'][$idx]); |
|
338 | 338 | } |
339 | 339 | |
340 | - if( isset( $data['order.relatedid'][$idx] ) ) { |
|
341 | - $item->setRelatedId( $data['order.relatedid'][$idx] ); |
|
340 | + if (isset($data['order.relatedid'][$idx])) { |
|
341 | + $item->setRelatedId($data['order.relatedid'][$idx]); |
|
342 | 342 | } |
343 | 343 | |
344 | - if( isset( $data['order.type'][$idx] ) ) { |
|
345 | - $item->setType( $data['order.type'][$idx] ); |
|
344 | + if (isset($data['order.type'][$idx])) { |
|
345 | + $item->setType($data['order.type'][$idx]); |
|
346 | 346 | } |
347 | 347 | |
348 | - $item->setBaseId( $order->getId() ); |
|
348 | + $item->setBaseId($order->getId()); |
|
349 | 349 | |
350 | - $manager->saveItem( $item ); |
|
350 | + $manager->saveItem($item); |
|
351 | 351 | } |
352 | 352 | } |
353 | 353 | |
@@ -358,13 +358,13 @@ discard block |
||
358 | 358 | * @param \Aimeos\MShop\Order\Item\Iface[] $invoices List of invoices belonging to the order |
359 | 359 | * @return string[] Multi-dimensional associative list of item data |
360 | 360 | */ |
361 | - protected function toArray( array $invoices ) |
|
361 | + protected function toArray(array $invoices) |
|
362 | 362 | { |
363 | 363 | $data = []; |
364 | 364 | |
365 | - foreach( $invoices as $item ) |
|
365 | + foreach ($invoices as $item) |
|
366 | 366 | { |
367 | - foreach( $item->toArray( true ) as $key => $value ) { |
|
367 | + foreach ($item->toArray(true) as $key => $value) { |
|
368 | 368 | $data[$key][] = $value; |
369 | 369 | } |
370 | 370 | } |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
380 | 380 | * @return string HTML output |
381 | 381 | */ |
382 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
382 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
383 | 383 | { |
384 | 384 | /** admin/jqadm/order/invoice/template-item |
385 | 385 | * Relative path to the HTML body template of the invoice subpart for orders. |
@@ -403,6 +403,6 @@ discard block |
||
403 | 403 | $tplconf = 'admin/jqadm/order/invoice/template-item'; |
404 | 404 | $default = 'order/item-invoice-standard'; |
405 | 405 | |
406 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
406 | + return $view->render($view->config($tplconf, $default)); |
|
407 | 407 | } |
408 | 408 | } |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | { |
43 | 43 | $view = $this->getView(); |
44 | 44 | |
45 | - $view->suggestData = $this->toArray( $view->item, true ); |
|
45 | + $view->suggestData = $this->toArray($view->item, true); |
|
46 | 46 | $view->suggestBody = ''; |
47 | 47 | |
48 | - foreach( $this->getSubClients() as $client ) { |
|
48 | + foreach ($this->getSubClients() as $client) { |
|
49 | 49 | $view->suggestBody .= $client->copy(); |
50 | 50 | } |
51 | 51 | |
52 | - return $this->render( $view ); |
|
52 | + return $this->render($view); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -62,20 +62,20 @@ discard block |
||
62 | 62 | { |
63 | 63 | $view = $this->getView(); |
64 | 64 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
65 | - $data = $view->param( 'related/suggest', [] ); |
|
65 | + $data = $view->param('related/suggest', []); |
|
66 | 66 | |
67 | - foreach( $view->value( $data, 'product.lists.id', [] ) as $idx => $value ) { |
|
67 | + foreach ($view->value($data, 'product.lists.id', []) as $idx => $value) { |
|
68 | 68 | $data['product.lists.siteid'][$idx] = $siteid; |
69 | 69 | } |
70 | 70 | |
71 | 71 | $view->suggestData = $data; |
72 | 72 | $view->suggestBody = ''; |
73 | 73 | |
74 | - foreach( $this->getSubClients() as $client ) { |
|
74 | + foreach ($this->getSubClients() as $client) { |
|
75 | 75 | $view->suggestBody .= $client->create(); |
76 | 76 | } |
77 | 77 | |
78 | - return $this->render( $view ); |
|
78 | + return $this->render($view); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | { |
89 | 89 | $view = $this->getView(); |
90 | 90 | |
91 | - $view->suggestData = $this->toArray( $view->item ); |
|
91 | + $view->suggestData = $this->toArray($view->item); |
|
92 | 92 | $view->suggestBody = ''; |
93 | 93 | |
94 | - foreach( $this->getSubClients() as $client ) { |
|
94 | + foreach ($this->getSubClients() as $client) { |
|
95 | 95 | $view->suggestBody .= $client->get(); |
96 | 96 | } |
97 | 97 | |
98 | - return $this->render( $view ); |
|
98 | + return $this->render($view); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | { |
107 | 107 | $view = $this->getView(); |
108 | 108 | |
109 | - $this->fromArray( $view->item, $view->param( 'related/suggest', [] ) ); |
|
109 | + $this->fromArray($view->item, $view->param('related/suggest', [])); |
|
110 | 110 | $view->suggestBody = ''; |
111 | 111 | |
112 | - foreach( $this->getSubClients() as $client ) { |
|
112 | + foreach ($this->getSubClients() as $client) { |
|
113 | 113 | $view->suggestBody .= $client->save(); |
114 | 114 | } |
115 | 115 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @param string|null $name Name of the sub-client (Default if null) |
123 | 123 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
124 | 124 | */ |
125 | - public function getSubClient( $type, $name = null ) |
|
125 | + public function getSubClient($type, $name = null) |
|
126 | 126 | { |
127 | 127 | /** admin/jqadm/product/related/suggest/decorators/excludes |
128 | 128 | * Excludes decorators added by the "common" option from the product JQAdm client |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @see admin/jqadm/product/related/suggest/decorators/excludes |
198 | 198 | * @see admin/jqadm/product/related/suggest/decorators/global |
199 | 199 | */ |
200 | - return $this->createSubClient( 'product/related/suggest/' . $type, $name ); |
|
200 | + return $this->createSubClient('product/related/suggest/' . $type, $name); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * @since 2016.01 |
242 | 242 | * @category Developer |
243 | 243 | */ |
244 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/related/suggest/standard/subparts', [] ); |
|
244 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/related/suggest/standard/subparts', []); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | |
@@ -251,29 +251,29 @@ discard block |
||
251 | 251 | * @param \Aimeos\MShop\Product\Item\Iface $item Product item object without referenced domain items |
252 | 252 | * @param string[] $data Data array |
253 | 253 | */ |
254 | - protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data ) |
|
254 | + protected function fromArray(\Aimeos\MShop\Product\Item\Iface $item, array $data) |
|
255 | 255 | { |
256 | - $listManager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' ); |
|
256 | + $listManager = \Aimeos\MShop::create($this->getContext(), 'product/lists'); |
|
257 | 257 | |
258 | - $listItem = $listManager->createItem()->setType( 'suggestion' ); |
|
259 | - $listItems = $item->getListItems( 'product', 'suggestion', null, false ); |
|
258 | + $listItem = $listManager->createItem()->setType('suggestion'); |
|
259 | + $listItems = $item->getListItems('product', 'suggestion', null, false); |
|
260 | 260 | |
261 | - foreach( $this->getValue( $data, 'product.lists.id', [] ) as $idx => $id ) |
|
261 | + foreach ($this->getValue($data, 'product.lists.id', []) as $idx => $id) |
|
262 | 262 | { |
263 | - if( isset( $listItems[$id] ) ) { |
|
264 | - $litem = $listItems[$id]; unset( $listItems[$id] ); |
|
263 | + if (isset($listItems[$id])) { |
|
264 | + $litem = $listItems[$id]; unset($listItems[$id]); |
|
265 | 265 | } else { |
266 | 266 | $litem = clone $listItem; |
267 | 267 | } |
268 | 268 | |
269 | - $litem->setId( $id ); |
|
270 | - $litem->setPosition( $idx ); |
|
271 | - $litem->setRefId( $this->getValue( $data, 'product.lists.refid/' . $idx ) ); |
|
269 | + $litem->setId($id); |
|
270 | + $litem->setPosition($idx); |
|
271 | + $litem->setRefId($this->getValue($data, 'product.lists.refid/' . $idx)); |
|
272 | 272 | |
273 | - $item->addListItem( 'product', $litem, $litem->getRefItem() ); |
|
273 | + $item->addListItem('product', $litem, $litem->getRefItem()); |
|
274 | 274 | } |
275 | 275 | |
276 | - return $item->deleteListItems( $listItems ); |
|
276 | + return $item->deleteListItems($listItems); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | |
@@ -284,26 +284,26 @@ discard block |
||
284 | 284 | * @param boolean $copy True if items should be copied, false if not |
285 | 285 | * @return string[] Multi-dimensional associative list of item data |
286 | 286 | */ |
287 | - protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false ) |
|
287 | + protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false) |
|
288 | 288 | { |
289 | 289 | $data = []; |
290 | 290 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
291 | 291 | |
292 | - foreach( $item->getListItems( 'product', 'suggestion', null, false ) as $listItem ) |
|
292 | + foreach ($item->getListItems('product', 'suggestion', null, false) as $listItem) |
|
293 | 293 | { |
294 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
294 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
295 | 295 | continue; |
296 | 296 | } |
297 | 297 | |
298 | - $list = $listItem->toArray( true ) + $refItem->toArray( true ); |
|
298 | + $list = $listItem->toArray(true) + $refItem->toArray(true); |
|
299 | 299 | |
300 | - if( $copy === true ) |
|
300 | + if ($copy === true) |
|
301 | 301 | { |
302 | 302 | $list['product.lists.siteid'] = $siteId; |
303 | 303 | $list['product.lists.id'] = ''; |
304 | 304 | } |
305 | 305 | |
306 | - foreach( $list as $key => $value ) { |
|
306 | + foreach ($list as $key => $value) { |
|
307 | 307 | $data[$key][] = $value; |
308 | 308 | } |
309 | 309 | } |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
319 | 319 | * @return string HTML output |
320 | 320 | */ |
321 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
321 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
322 | 322 | { |
323 | 323 | /** admin/jqadm/product/related/suggest/template-item |
324 | 324 | * Relative path to the HTML body template of the suggest related subpart for products. |
@@ -342,6 +342,6 @@ discard block |
||
342 | 342 | $tplconf = 'admin/jqadm/product/related/suggest/template-item'; |
343 | 343 | $default = 'product/item-related-suggest-standard'; |
344 | 344 | |
345 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
345 | + return $view->render($view->config($tplconf, $default)); |
|
346 | 346 | } |
347 | 347 | } |
348 | 348 | \ No newline at end of file |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | { |
43 | 43 | $view = $this->getView(); |
44 | 44 | |
45 | - $view->boughtData = $this->toArray( $view->item, true ); |
|
45 | + $view->boughtData = $this->toArray($view->item, true); |
|
46 | 46 | $view->boughtBody = ''; |
47 | 47 | |
48 | - foreach( $this->getSubClients() as $client ) { |
|
48 | + foreach ($this->getSubClients() as $client) { |
|
49 | 49 | $view->boughtBody .= $client->copy(); |
50 | 50 | } |
51 | 51 | |
52 | - return $this->render( $view ); |
|
52 | + return $this->render($view); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -62,20 +62,20 @@ discard block |
||
62 | 62 | { |
63 | 63 | $view = $this->getView(); |
64 | 64 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
65 | - $data = $view->param( 'related/bought', [] ); |
|
65 | + $data = $view->param('related/bought', []); |
|
66 | 66 | |
67 | - foreach( $view->value( $data, 'product.lists.id', [] ) as $idx => $value ) { |
|
67 | + foreach ($view->value($data, 'product.lists.id', []) as $idx => $value) { |
|
68 | 68 | $data['product.lists.siteid'][$idx] = $siteid; |
69 | 69 | } |
70 | 70 | |
71 | 71 | $view->boughtData = $data; |
72 | 72 | $view->boughtBody = ''; |
73 | 73 | |
74 | - foreach( $this->getSubClients() as $client ) { |
|
74 | + foreach ($this->getSubClients() as $client) { |
|
75 | 75 | $view->boughtBody .= $client->create(); |
76 | 76 | } |
77 | 77 | |
78 | - return $this->render( $view ); |
|
78 | + return $this->render($view); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | { |
89 | 89 | $view = $this->getView(); |
90 | 90 | |
91 | - $view->boughtData = $this->toArray( $view->item ); |
|
91 | + $view->boughtData = $this->toArray($view->item); |
|
92 | 92 | $view->boughtBody = ''; |
93 | 93 | |
94 | - foreach( $this->getSubClients() as $client ) { |
|
94 | + foreach ($this->getSubClients() as $client) { |
|
95 | 95 | $view->boughtBody .= $client->get(); |
96 | 96 | } |
97 | 97 | |
98 | - return $this->render( $view ); |
|
98 | + return $this->render($view); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | { |
107 | 107 | $view = $this->getView(); |
108 | 108 | |
109 | - $this->fromArray( $view->item, $view->param( 'related/bought', [] ) ); |
|
109 | + $this->fromArray($view->item, $view->param('related/bought', [])); |
|
110 | 110 | $view->boughtBody = ''; |
111 | 111 | |
112 | - foreach( $this->getSubClients() as $client ) { |
|
112 | + foreach ($this->getSubClients() as $client) { |
|
113 | 113 | $view->boughtBody .= $client->save(); |
114 | 114 | } |
115 | 115 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @param string|null $name Name of the sub-client (Default if null) |
123 | 123 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
124 | 124 | */ |
125 | - public function getSubClient( $type, $name = null ) |
|
125 | + public function getSubClient($type, $name = null) |
|
126 | 126 | { |
127 | 127 | /** admin/jqadm/product/related/bought/decorators/excludes |
128 | 128 | * Excludes decorators added by the "common" option from the product JQAdm client |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @see admin/jqadm/product/related/bought/decorators/excludes |
198 | 198 | * @see admin/jqadm/product/related/bought/decorators/global |
199 | 199 | */ |
200 | - return $this->createSubClient( 'product/related/bought/' . $type, $name ); |
|
200 | + return $this->createSubClient('product/related/bought/' . $type, $name); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * @since 2016.01 |
242 | 242 | * @category Developer |
243 | 243 | */ |
244 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/related/bought/standard/subparts', [] ); |
|
244 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/related/bought/standard/subparts', []); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | |
@@ -251,29 +251,29 @@ discard block |
||
251 | 251 | * @param \Aimeos\MShop\Product\Item\Iface $item Product item object without referenced domain items |
252 | 252 | * @param string[] $data Data array |
253 | 253 | */ |
254 | - protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data ) |
|
254 | + protected function fromArray(\Aimeos\MShop\Product\Item\Iface $item, array $data) |
|
255 | 255 | { |
256 | - $listManager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' ); |
|
256 | + $listManager = \Aimeos\MShop::create($this->getContext(), 'product/lists'); |
|
257 | 257 | |
258 | - $listItem = $listManager->createItem()->setType( 'bought-together' ); |
|
259 | - $listItems = $item->getListItems( 'product', 'bought-together', null, false ); |
|
258 | + $listItem = $listManager->createItem()->setType('bought-together'); |
|
259 | + $listItems = $item->getListItems('product', 'bought-together', null, false); |
|
260 | 260 | |
261 | - foreach( $this->getValue( $data, 'product.lists.id', [] ) as $idx => $id ) |
|
261 | + foreach ($this->getValue($data, 'product.lists.id', []) as $idx => $id) |
|
262 | 262 | { |
263 | - if( isset( $listItems[$id] ) ) { |
|
264 | - $litem = $listItems[$id]; unset( $listItems[$id] ); |
|
263 | + if (isset($listItems[$id])) { |
|
264 | + $litem = $listItems[$id]; unset($listItems[$id]); |
|
265 | 265 | } else { |
266 | 266 | $litem = clone $listItem; |
267 | 267 | } |
268 | 268 | |
269 | - $litem->setId( $id ); |
|
270 | - $litem->setPosition( $idx ); |
|
271 | - $litem->setRefId( $this->getValue( $data, 'product.lists.refid/' . $idx ) ); |
|
269 | + $litem->setId($id); |
|
270 | + $litem->setPosition($idx); |
|
271 | + $litem->setRefId($this->getValue($data, 'product.lists.refid/' . $idx)); |
|
272 | 272 | |
273 | - $item->addListItem( 'product', $litem, $litem->getRefItem() ); |
|
273 | + $item->addListItem('product', $litem, $litem->getRefItem()); |
|
274 | 274 | } |
275 | 275 | |
276 | - return $item->deleteListItems( $listItems ); |
|
276 | + return $item->deleteListItems($listItems); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | |
@@ -284,26 +284,26 @@ discard block |
||
284 | 284 | * @param boolean $copy True if items should be copied, false if not |
285 | 285 | * @return string[] Multi-dimensional associative list of item data |
286 | 286 | */ |
287 | - protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false ) |
|
287 | + protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false) |
|
288 | 288 | { |
289 | 289 | $data = []; |
290 | 290 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
291 | 291 | |
292 | - foreach( $item->getListItems( 'product', 'bought-together', null, false ) as $listItem ) |
|
292 | + foreach ($item->getListItems('product', 'bought-together', null, false) as $listItem) |
|
293 | 293 | { |
294 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
294 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
295 | 295 | continue; |
296 | 296 | } |
297 | 297 | |
298 | - $list = $listItem->toArray( true ) + $refItem->toArray( true ); |
|
298 | + $list = $listItem->toArray(true) + $refItem->toArray(true); |
|
299 | 299 | |
300 | - if( $copy === true ) |
|
300 | + if ($copy === true) |
|
301 | 301 | { |
302 | 302 | $list['product.lists.siteid'] = $siteId; |
303 | 303 | $list['product.lists.id'] = ''; |
304 | 304 | } |
305 | 305 | |
306 | - foreach( $list as $key => $value ) { |
|
306 | + foreach ($list as $key => $value) { |
|
307 | 307 | $data[$key][] = $value; |
308 | 308 | } |
309 | 309 | } |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
319 | 319 | * @return string HTML output |
320 | 320 | */ |
321 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
321 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
322 | 322 | { |
323 | 323 | /** admin/jqadm/product/related/bought/template-item |
324 | 324 | * Relative path to the HTML body template of the bought related subpart for products. |
@@ -342,6 +342,6 @@ discard block |
||
342 | 342 | $tplconf = 'admin/jqadm/product/related/bought/template-item'; |
343 | 343 | $default = 'product/item-related-bought-standard'; |
344 | 344 | |
345 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
345 | + return $view->render($view->config($tplconf, $default)); |
|
346 | 346 | } |
347 | 347 | } |
348 | 348 | \ No newline at end of file |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | namespace Aimeos\Admin\JQAdm\Product\Subscription; |
12 | 12 | |
13 | -sprintf( 'subscription' ); // for translation |
|
13 | +sprintf('subscription'); // for translation |
|
14 | 14 | |
15 | 15 | |
16 | 16 | /** |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | { |
45 | 45 | $view = $this->getView(); |
46 | 46 | |
47 | - $view->subscriptionData = $this->toArray( $view->item, true ); |
|
47 | + $view->subscriptionData = $this->toArray($view->item, true); |
|
48 | 48 | $view->subscriptionBody = ''; |
49 | 49 | |
50 | - foreach( $this->getSubClients() as $client ) { |
|
50 | + foreach ($this->getSubClients() as $client) { |
|
51 | 51 | $view->subscriptionBody .= $client->copy(); |
52 | 52 | } |
53 | 53 | |
54 | - return $this->render( $view ); |
|
54 | + return $this->render($view); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
@@ -64,20 +64,20 @@ discard block |
||
64 | 64 | { |
65 | 65 | $view = $this->getView(); |
66 | 66 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
67 | - $data = $view->param( 'subscription', [] ); |
|
67 | + $data = $view->param('subscription', []); |
|
68 | 68 | |
69 | - foreach( $view->value( $data, 'product.lists.id', [] ) as $idx => $value ) { |
|
69 | + foreach ($view->value($data, 'product.lists.id', []) as $idx => $value) { |
|
70 | 70 | $data['product.lists.siteid'][$idx] = $siteid; |
71 | 71 | } |
72 | 72 | |
73 | 73 | $view->subscriptionData = $data; |
74 | 74 | $view->subscriptionBody = ''; |
75 | 75 | |
76 | - foreach( $this->getSubClients() as $client ) { |
|
76 | + foreach ($this->getSubClients() as $client) { |
|
77 | 77 | $view->subscriptionBody .= $client->create(); |
78 | 78 | } |
79 | 79 | |
80 | - return $this->render( $view ); |
|
80 | + return $this->render($view); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | { |
91 | 91 | $view = $this->getView(); |
92 | 92 | |
93 | - $view->subscriptionData = $this->toArray( $view->item ); |
|
93 | + $view->subscriptionData = $this->toArray($view->item); |
|
94 | 94 | $view->subscriptionBody = ''; |
95 | 95 | |
96 | - foreach( $this->getSubClients() as $client ) { |
|
96 | + foreach ($this->getSubClients() as $client) { |
|
97 | 97 | $view->subscriptionBody .= $client->get(); |
98 | 98 | } |
99 | 99 | |
100 | - return $this->render( $view ); |
|
100 | + return $this->render($view); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | |
@@ -110,26 +110,26 @@ discard block |
||
110 | 110 | |
111 | 111 | try |
112 | 112 | { |
113 | - $this->fromArray( $view->item, $view->param( 'subscription', [] ) ); |
|
113 | + $this->fromArray($view->item, $view->param('subscription', [])); |
|
114 | 114 | $view->subscriptionBody = ''; |
115 | 115 | |
116 | - foreach( $this->getSubClients() as $client ) { |
|
116 | + foreach ($this->getSubClients() as $client) { |
|
117 | 117 | $view->subscriptionBody .= $client->save(); |
118 | 118 | } |
119 | 119 | |
120 | 120 | return; |
121 | 121 | } |
122 | - catch( \Aimeos\MShop\Exception $e ) |
|
122 | + catch (\Aimeos\MShop\Exception $e) |
|
123 | 123 | { |
124 | - $error = array( 'product-item-subscription' => $this->getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) ); |
|
125 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
126 | - $this->logException( $e ); |
|
124 | + $error = array('product-item-subscription' => $this->getContext()->getI18n()->dt('mshop', $e->getMessage())); |
|
125 | + $view->errors = $view->get('errors', []) + $error; |
|
126 | + $this->logException($e); |
|
127 | 127 | } |
128 | - catch( \Exception $e ) |
|
128 | + catch (\Exception $e) |
|
129 | 129 | { |
130 | - $error = array( 'product-item-subscription' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine() ); |
|
131 | - $view->errors = $view->get( 'errors', [] ) + $error; |
|
132 | - $this->logException( $e ); |
|
130 | + $error = array('product-item-subscription' => $e->getMessage() . ', ' . $e->getFile() . ':' . $e->getLine()); |
|
131 | + $view->errors = $view->get('errors', []) + $error; |
|
132 | + $this->logException($e); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | throw new \Aimeos\Admin\JQAdm\Exception(); |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @param string|null $name Name of the sub-client (Default if null) |
144 | 144 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
145 | 145 | */ |
146 | - public function getSubClient( $type, $name = null ) |
|
146 | + public function getSubClient($type, $name = null) |
|
147 | 147 | { |
148 | 148 | /** admin/jqadm/product/subscription/decorators/excludes |
149 | 149 | * Excludes decorators added by the "common" subscription from the product JQAdm client |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | * @see admin/jqadm/product/subscription/decorators/excludes |
219 | 219 | * @see admin/jqadm/product/subscription/decorators/global |
220 | 220 | */ |
221 | - return $this->createSubClient( 'product/subscription/' . $type, $name ); |
|
221 | + return $this->createSubClient('product/subscription/' . $type, $name); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | |
@@ -229,17 +229,17 @@ discard block |
||
229 | 229 | */ |
230 | 230 | protected function getIntervalItems() |
231 | 231 | { |
232 | - $manager = \Aimeos\MShop::create( $this->getContext(), 'attribute' ); |
|
232 | + $manager = \Aimeos\MShop::create($this->getContext(), 'attribute'); |
|
233 | 233 | |
234 | 234 | $search = $manager->createSearch(); |
235 | 235 | $expr = [ |
236 | - $search->compare( '==', 'attribute.type', 'interval' ), |
|
237 | - $search->compare( '==', 'attribute.domain', 'product' ), |
|
236 | + $search->compare('==', 'attribute.type', 'interval'), |
|
237 | + $search->compare('==', 'attribute.domain', 'product'), |
|
238 | 238 | ]; |
239 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
240 | - $search->setSortations( [$search->sort( '+', 'attribute.code' )] ); |
|
239 | + $search->setConditions($search->combine('&&', $expr)); |
|
240 | + $search->setSortations([$search->sort('+', 'attribute.code')]); |
|
241 | 241 | |
242 | - return $manager->searchItems( $search ); |
|
242 | + return $manager->searchItems($search); |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * @since 2018.04 |
284 | 284 | * @category Developer |
285 | 285 | */ |
286 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/subscription/standard/subparts', [] ); |
|
286 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/subscription/standard/subparts', []); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | |
@@ -293,37 +293,37 @@ discard block |
||
293 | 293 | * @param \Aimeos\MShop\Product\Item\Iface $item Product item object without referenced domain items |
294 | 294 | * @param string[] $data Data array |
295 | 295 | */ |
296 | - protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data ) |
|
296 | + protected function fromArray(\Aimeos\MShop\Product\Item\Iface $item, array $data) |
|
297 | 297 | { |
298 | 298 | $context = $this->getContext(); |
299 | 299 | |
300 | - $attrManager = \Aimeos\MShop::create( $context, 'attribute' ); |
|
301 | - $listManager = \Aimeos\MShop::create( $context, 'product/lists' ); |
|
300 | + $attrManager = \Aimeos\MShop::create($context, 'attribute'); |
|
301 | + $listManager = \Aimeos\MShop::create($context, 'product/lists'); |
|
302 | 302 | |
303 | - $listItems = $item->getListItems( 'attribute', 'config', 'interval', false ); |
|
303 | + $listItems = $item->getListItems('attribute', 'config', 'interval', false); |
|
304 | 304 | |
305 | - foreach( $data as $idx => $entry ) |
|
305 | + foreach ($data as $idx => $entry) |
|
306 | 306 | { |
307 | - if( !array_key_exists( 'attribute.id', $entry ) ) { |
|
307 | + if (!array_key_exists('attribute.id', $entry)) { |
|
308 | 308 | continue; |
309 | 309 | } |
310 | 310 | |
311 | - if( $entry['attribute.id'] == '' || ( $listItem = $item->getListItem( 'attribute', 'config', $entry['attribute.id'], false ) ) === null ) { |
|
312 | - $listItem = $listManager->createItem()->setType( 'config' ); |
|
311 | + if ($entry['attribute.id'] == '' || ($listItem = $item->getListItem('attribute', 'config', $entry['attribute.id'], false)) === null) { |
|
312 | + $listItem = $listManager->createItem()->setType('config'); |
|
313 | 313 | } |
314 | 314 | |
315 | - if( $entry['attribute.id'] == '' || ( $refItem = $listItem->getRefItem() ) === null ) |
|
315 | + if ($entry['attribute.id'] == '' || ($refItem = $listItem->getRefItem()) === null) |
|
316 | 316 | { |
317 | - $refItem = $attrManager->createItem()->setType( 'interval' ); |
|
318 | - $refItem->fromArray( $entry ); |
|
317 | + $refItem = $attrManager->createItem()->setType('interval'); |
|
318 | + $refItem->fromArray($entry); |
|
319 | 319 | } |
320 | 320 | |
321 | - unset( $listItems[$listItem->getId()] ); |
|
321 | + unset($listItems[$listItem->getId()]); |
|
322 | 322 | |
323 | - $item->addListItem( 'attribute', $listItem->setPosition( $idx ), $refItem ); |
|
323 | + $item->addListItem('attribute', $listItem->setPosition($idx), $refItem); |
|
324 | 324 | } |
325 | 325 | |
326 | - $item->deleteListItems( $listItems ); |
|
326 | + $item->deleteListItems($listItems); |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | |
@@ -334,20 +334,20 @@ discard block |
||
334 | 334 | * @param boolean $copy True if items should be copied, false if not |
335 | 335 | * @return string[] Multi-dimensional associative list of item data |
336 | 336 | */ |
337 | - protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false ) |
|
337 | + protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false) |
|
338 | 338 | { |
339 | 339 | $data = $map = []; |
340 | 340 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
341 | 341 | |
342 | - foreach( $item->getListItems( 'attribute', 'config', 'interval', false ) as $listItem ) { |
|
342 | + foreach ($item->getListItems('attribute', 'config', 'interval', false) as $listItem) { |
|
343 | 343 | $map[$listItem->getRefId()] = $listItem; |
344 | 344 | } |
345 | 345 | |
346 | - foreach( $this->getIntervalItems() as $attrId => $attrItem ) |
|
346 | + foreach ($this->getIntervalItems() as $attrId => $attrItem) |
|
347 | 347 | { |
348 | - $list = $attrItem->toArray( true ); |
|
348 | + $list = $attrItem->toArray(true); |
|
349 | 349 | |
350 | - if( isset( $map[$attrId] ) && $copy !== true ) |
|
350 | + if (isset($map[$attrId]) && $copy !== true) |
|
351 | 351 | { |
352 | 352 | $list['product.lists.siteid'] = (string) $map[$attrId]->getSiteId(); |
353 | 353 | $list['product.lists.id'] = (string) $map[$attrId]->getId(); |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | $matches = []; |
362 | 362 | $list['Y'] = $list['M'] = $list['W'] = $list['D'] = 0; |
363 | 363 | |
364 | - if( preg_match( '/^P([0-9]+)Y([0-9]+)M([0-9]+)W([0-9]+)D$/', $list['attribute.code'], $matches ) === 1 ) |
|
364 | + if (preg_match('/^P([0-9]+)Y([0-9]+)M([0-9]+)W([0-9]+)D$/', $list['attribute.code'], $matches) === 1) |
|
365 | 365 | { |
366 | 366 | $list['Y'] = $matches[1]; |
367 | 367 | $list['M'] = $matches[2]; |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
383 | 383 | * @return string HTML output |
384 | 384 | */ |
385 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
385 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
386 | 386 | { |
387 | 387 | /** admin/jqadm/product/subscription/template-item |
388 | 388 | * Relative path to the HTML body template of the subscription subpart for products. |
@@ -406,6 +406,6 @@ discard block |
||
406 | 406 | $tplconf = 'admin/jqadm/product/subscription/template-item'; |
407 | 407 | $default = 'product/item-subscription-standard'; |
408 | 408 | |
409 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
409 | + return $view->render($view->config($tplconf, $default)); |
|
410 | 410 | } |
411 | 411 | } |
412 | 412 | \ No newline at end of file |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | { |
43 | 43 | $view = $this->getView(); |
44 | 44 | |
45 | - $view->customData = $this->toArray( $view->item, true ); |
|
45 | + $view->customData = $this->toArray($view->item, true); |
|
46 | 46 | $view->customBody = ''; |
47 | 47 | |
48 | - foreach( $this->getSubClients() as $client ) { |
|
48 | + foreach ($this->getSubClients() as $client) { |
|
49 | 49 | $view->customBody .= $client->copy(); |
50 | 50 | } |
51 | 51 | |
52 | - return $this->render( $view ); |
|
52 | + return $this->render($view); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -62,20 +62,20 @@ discard block |
||
62 | 62 | { |
63 | 63 | $view = $this->getView(); |
64 | 64 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
65 | - $data = $view->param( 'option/custom', [] ); |
|
65 | + $data = $view->param('option/custom', []); |
|
66 | 66 | |
67 | - foreach( $view->value( $data, 'product.lists.id', [] ) as $idx => $value ) { |
|
67 | + foreach ($view->value($data, 'product.lists.id', []) as $idx => $value) { |
|
68 | 68 | $data['product.lists.siteid'][$idx] = $siteid; |
69 | 69 | } |
70 | 70 | |
71 | 71 | $view->customData = $data; |
72 | 72 | $view->customBody = ''; |
73 | 73 | |
74 | - foreach( $this->getSubClients() as $client ) { |
|
74 | + foreach ($this->getSubClients() as $client) { |
|
75 | 75 | $view->customBody .= $client->create(); |
76 | 76 | } |
77 | 77 | |
78 | - return $this->render( $view ); |
|
78 | + return $this->render($view); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | { |
89 | 89 | $view = $this->getView(); |
90 | 90 | |
91 | - $view->customData = $this->toArray( $view->item ); |
|
91 | + $view->customData = $this->toArray($view->item); |
|
92 | 92 | $view->customBody = ''; |
93 | 93 | |
94 | - foreach( $this->getSubClients() as $client ) { |
|
94 | + foreach ($this->getSubClients() as $client) { |
|
95 | 95 | $view->customBody .= $client->get(); |
96 | 96 | } |
97 | 97 | |
98 | - return $this->render( $view ); |
|
98 | + return $this->render($view); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | { |
107 | 107 | $view = $this->getView(); |
108 | 108 | |
109 | - $this->fromArray( $view->item, $view->param( 'option/custom', [] ) ); |
|
109 | + $this->fromArray($view->item, $view->param('option/custom', [])); |
|
110 | 110 | $view->customBody = ''; |
111 | 111 | |
112 | - foreach( $this->getSubClients() as $client ) { |
|
112 | + foreach ($this->getSubClients() as $client) { |
|
113 | 113 | $view->customBody .= $client->save(); |
114 | 114 | } |
115 | 115 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @param string|null $name Name of the sub-client (Default if null) |
123 | 123 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
124 | 124 | */ |
125 | - public function getSubClient( $type, $name = null ) |
|
125 | + public function getSubClient($type, $name = null) |
|
126 | 126 | { |
127 | 127 | /** admin/jqadm/product/option/custom/decorators/excludes |
128 | 128 | * Excludes decorators added by the "common" option from the product JQAdm client |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @see admin/jqadm/product/option/custom/decorators/excludes |
198 | 198 | * @see admin/jqadm/product/option/custom/decorators/global |
199 | 199 | */ |
200 | - return $this->createSubClient( 'product/option/custom/' . $type, $name ); |
|
200 | + return $this->createSubClient('product/option/custom/' . $type, $name); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * @since 2017.03 |
242 | 242 | * @category Developer |
243 | 243 | */ |
244 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/option/custom/standard/subparts', [] ); |
|
244 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/option/custom/standard/subparts', []); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | |
@@ -251,29 +251,29 @@ discard block |
||
251 | 251 | * @param \Aimeos\MShop\Product\Item\Iface $item Product item object without referenced domain items |
252 | 252 | * @param string[] $data Data array |
253 | 253 | */ |
254 | - protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data ) |
|
254 | + protected function fromArray(\Aimeos\MShop\Product\Item\Iface $item, array $data) |
|
255 | 255 | { |
256 | - $listManager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' ); |
|
256 | + $listManager = \Aimeos\MShop::create($this->getContext(), 'product/lists'); |
|
257 | 257 | |
258 | - $listItem = $listManager->createItem()->setType( 'custom' ); |
|
259 | - $listItems = $item->getListItems( 'attribute', 'custom', null, false ); |
|
258 | + $listItem = $listManager->createItem()->setType('custom'); |
|
259 | + $listItems = $item->getListItems('attribute', 'custom', null, false); |
|
260 | 260 | |
261 | - foreach( $this->getValue( $data, 'product.lists.id', [] ) as $idx => $id ) |
|
261 | + foreach ($this->getValue($data, 'product.lists.id', []) as $idx => $id) |
|
262 | 262 | { |
263 | - if( isset( $listItems[$id] ) ) { |
|
264 | - $litem = $listItems[$id]; unset( $listItems[$id] ); |
|
263 | + if (isset($listItems[$id])) { |
|
264 | + $litem = $listItems[$id]; unset($listItems[$id]); |
|
265 | 265 | } else { |
266 | 266 | $litem = clone $listItem; |
267 | 267 | } |
268 | 268 | |
269 | - $litem->setId( $id ); |
|
270 | - $litem->setPosition( $idx ); |
|
271 | - $litem->setRefId( $this->getValue( $data, 'product.lists.refid/' . $idx ) ); |
|
269 | + $litem->setId($id); |
|
270 | + $litem->setPosition($idx); |
|
271 | + $litem->setRefId($this->getValue($data, 'product.lists.refid/' . $idx)); |
|
272 | 272 | |
273 | - $item->addListItem( 'attribute', $litem, $litem->getRefItem() ); |
|
273 | + $item->addListItem('attribute', $litem, $litem->getRefItem()); |
|
274 | 274 | } |
275 | 275 | |
276 | - return $item->deleteListItems( $listItems ); |
|
276 | + return $item->deleteListItems($listItems); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | |
@@ -284,26 +284,26 @@ discard block |
||
284 | 284 | * @param boolean $copy True if items should be copied, false if not |
285 | 285 | * @return string[] Multi-dimensional associative list of item data |
286 | 286 | */ |
287 | - protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false ) |
|
287 | + protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false) |
|
288 | 288 | { |
289 | 289 | $data = []; |
290 | 290 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
291 | 291 | |
292 | - foreach( $item->getListItems( 'attribute', 'custom', null, false ) as $listItem ) |
|
292 | + foreach ($item->getListItems('attribute', 'custom', null, false) as $listItem) |
|
293 | 293 | { |
294 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
294 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
295 | 295 | continue; |
296 | 296 | } |
297 | 297 | |
298 | - $list = $listItem->toArray( true ) + $refItem->toArray( true ); |
|
298 | + $list = $listItem->toArray(true) + $refItem->toArray(true); |
|
299 | 299 | |
300 | - if( $copy === true ) |
|
300 | + if ($copy === true) |
|
301 | 301 | { |
302 | 302 | $list['product.lists.siteid'] = $siteId; |
303 | 303 | $list['product.lists.id'] = ''; |
304 | 304 | } |
305 | 305 | |
306 | - foreach( $list as $key => $value ) { |
|
306 | + foreach ($list as $key => $value) { |
|
307 | 307 | $data[$key][] = $value; |
308 | 308 | } |
309 | 309 | } |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
319 | 319 | * @return string HTML output |
320 | 320 | */ |
321 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
321 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
322 | 322 | { |
323 | 323 | /** admin/jqadm/product/option/custom/template-item |
324 | 324 | * Relative path to the HTML body template of the custom option subpart for products. |
@@ -342,6 +342,6 @@ discard block |
||
342 | 342 | $tplconf = 'admin/jqadm/product/option/custom/template-item'; |
343 | 343 | $default = 'product/item-option-custom-standard'; |
344 | 344 | |
345 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
345 | + return $view->render($view->config($tplconf, $default)); |
|
346 | 346 | } |
347 | 347 | } |
348 | 348 | \ No newline at end of file |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | { |
43 | 43 | $view = $this->getView(); |
44 | 44 | |
45 | - $view->configData = $this->toArray( $view->item, true ); |
|
45 | + $view->configData = $this->toArray($view->item, true); |
|
46 | 46 | $view->configBody = ''; |
47 | 47 | |
48 | - foreach( $this->getSubClients() as $client ) { |
|
48 | + foreach ($this->getSubClients() as $client) { |
|
49 | 49 | $view->configBody .= $client->copy(); |
50 | 50 | } |
51 | 51 | |
52 | - return $this->render( $view ); |
|
52 | + return $this->render($view); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -62,20 +62,20 @@ discard block |
||
62 | 62 | { |
63 | 63 | $view = $this->getView(); |
64 | 64 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
65 | - $data = $view->param( 'option/config', [] ); |
|
65 | + $data = $view->param('option/config', []); |
|
66 | 66 | |
67 | - foreach( $view->value( $data, 'product.lists.id', [] ) as $idx => $value ) { |
|
67 | + foreach ($view->value($data, 'product.lists.id', []) as $idx => $value) { |
|
68 | 68 | $data['product.lists.siteid'][$idx] = $siteid; |
69 | 69 | } |
70 | 70 | |
71 | 71 | $view->configData = $data; |
72 | 72 | $view->configBody = ''; |
73 | 73 | |
74 | - foreach( $this->getSubClients() as $client ) { |
|
74 | + foreach ($this->getSubClients() as $client) { |
|
75 | 75 | $view->configBody .= $client->create(); |
76 | 76 | } |
77 | 77 | |
78 | - return $this->render( $view ); |
|
78 | + return $this->render($view); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | { |
89 | 89 | $view = $this->getView(); |
90 | 90 | |
91 | - $view->configData = $this->toArray( $view->item ); |
|
91 | + $view->configData = $this->toArray($view->item); |
|
92 | 92 | $view->configBody = ''; |
93 | 93 | |
94 | - foreach( $this->getSubClients() as $client ) { |
|
94 | + foreach ($this->getSubClients() as $client) { |
|
95 | 95 | $view->configBody .= $client->get(); |
96 | 96 | } |
97 | 97 | |
98 | - return $this->render( $view ); |
|
98 | + return $this->render($view); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | { |
107 | 107 | $view = $this->getView(); |
108 | 108 | |
109 | - $this->fromArray( $view->item, $view->param( 'option/config', [] ) ); |
|
109 | + $this->fromArray($view->item, $view->param('option/config', [])); |
|
110 | 110 | $view->configBody = ''; |
111 | 111 | |
112 | - foreach( $this->getSubClients() as $client ) { |
|
112 | + foreach ($this->getSubClients() as $client) { |
|
113 | 113 | $view->configBody .= $client->save(); |
114 | 114 | } |
115 | 115 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @param string|null $name Name of the sub-client (Default if null) |
123 | 123 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
124 | 124 | */ |
125 | - public function getSubClient( $type, $name = null ) |
|
125 | + public function getSubClient($type, $name = null) |
|
126 | 126 | { |
127 | 127 | /** admin/jqadm/product/option/config/decorators/excludes |
128 | 128 | * Excludes decorators added by the "common" option from the product JQAdm client |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @see admin/jqadm/product/option/config/decorators/excludes |
198 | 198 | * @see admin/jqadm/product/option/config/decorators/global |
199 | 199 | */ |
200 | - return $this->createSubClient( 'product/option/config/' . $type, $name ); |
|
200 | + return $this->createSubClient('product/option/config/' . $type, $name); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * @since 2017.03 |
242 | 242 | * @category Developer |
243 | 243 | */ |
244 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/option/config/standard/subparts', [] ); |
|
244 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/option/config/standard/subparts', []); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | |
@@ -251,31 +251,31 @@ discard block |
||
251 | 251 | * @param \Aimeos\MShop\Product\Item\Iface $item Product item object without referenced domain items |
252 | 252 | * @param string[] $data Data array |
253 | 253 | */ |
254 | - protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data ) |
|
254 | + protected function fromArray(\Aimeos\MShop\Product\Item\Iface $item, array $data) |
|
255 | 255 | { |
256 | - $listManager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' ); |
|
256 | + $listManager = \Aimeos\MShop::create($this->getContext(), 'product/lists'); |
|
257 | 257 | |
258 | - $listItem = $listManager->createItem()->setType( 'config' ); |
|
259 | - $listItems = $item->getListItems( 'attribute', 'config', null, false ); |
|
258 | + $listItem = $listManager->createItem()->setType('config'); |
|
259 | + $listItems = $item->getListItems('attribute', 'config', null, false); |
|
260 | 260 | |
261 | - foreach( $this->getValue( $data, 'product.lists.id', [] ) as $idx => $id ) |
|
261 | + foreach ($this->getValue($data, 'product.lists.id', []) as $idx => $id) |
|
262 | 262 | { |
263 | - if( isset( $listItems[$id] ) ) { |
|
264 | - $litem = $listItems[$id]; unset( $listItems[$id] ); |
|
263 | + if (isset($listItems[$id])) { |
|
264 | + $litem = $listItems[$id]; unset($listItems[$id]); |
|
265 | 265 | } else { |
266 | 266 | $litem = clone $listItem; |
267 | 267 | } |
268 | 268 | |
269 | - $litem->setId( $id ); |
|
270 | - $litem->setPosition( $idx ); |
|
271 | - $litem->setRefId( $this->getValue( $data, 'product.lists.refid/' . $idx ) ); |
|
269 | + $litem->setId($id); |
|
270 | + $litem->setPosition($idx); |
|
271 | + $litem->setRefId($this->getValue($data, 'product.lists.refid/' . $idx)); |
|
272 | 272 | |
273 | - $item->addListItem( 'attribute', $litem, $litem->getRefItem() ); |
|
273 | + $item->addListItem('attribute', $litem, $litem->getRefItem()); |
|
274 | 274 | |
275 | 275 | |
276 | 276 | } |
277 | 277 | |
278 | - return $item->deleteListItems( $listItems ); |
|
278 | + return $item->deleteListItems($listItems); |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | |
@@ -286,26 +286,26 @@ discard block |
||
286 | 286 | * @param boolean $copy True if items should be copied, false if not |
287 | 287 | * @return string[] Multi-dimensional associative list of item data |
288 | 288 | */ |
289 | - protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false ) |
|
289 | + protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false) |
|
290 | 290 | { |
291 | 291 | $data = []; |
292 | 292 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
293 | 293 | |
294 | - foreach( $item->getListItems( 'attribute', 'config', null, false ) as $listItem ) |
|
294 | + foreach ($item->getListItems('attribute', 'config', null, false) as $listItem) |
|
295 | 295 | { |
296 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
296 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
297 | 297 | continue; |
298 | 298 | } |
299 | 299 | |
300 | - $list = $listItem->toArray( true ) + $refItem->toArray( true ); |
|
300 | + $list = $listItem->toArray(true) + $refItem->toArray(true); |
|
301 | 301 | |
302 | - if( $copy === true ) |
|
302 | + if ($copy === true) |
|
303 | 303 | { |
304 | 304 | $list['product.lists.siteid'] = $siteId; |
305 | 305 | $list['product.lists.id'] = ''; |
306 | 306 | } |
307 | 307 | |
308 | - foreach( $list as $key => $value ) { |
|
308 | + foreach ($list as $key => $value) { |
|
309 | 309 | $data[$key][] = $value; |
310 | 310 | } |
311 | 311 | } |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
321 | 321 | * @return string HTML output |
322 | 322 | */ |
323 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
323 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
324 | 324 | { |
325 | 325 | /** admin/jqadm/product/option/config/template-item |
326 | 326 | * Relative path to the HTML body template of the config option subpart for products. |
@@ -344,6 +344,6 @@ discard block |
||
344 | 344 | $tplconf = 'admin/jqadm/product/option/config/template-item'; |
345 | 345 | $default = 'product/item-option-config-standard'; |
346 | 346 | |
347 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
347 | + return $view->render($view->config($tplconf, $default)); |
|
348 | 348 | } |
349 | 349 | } |
350 | 350 | \ No newline at end of file |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | { |
43 | 43 | $view = $this->getView(); |
44 | 44 | |
45 | - $view->hiddenData = $this->toArray( $view->item, true ); |
|
45 | + $view->hiddenData = $this->toArray($view->item, true); |
|
46 | 46 | $view->hiddenBody = ''; |
47 | 47 | |
48 | - foreach( $this->getSubClients() as $client ) { |
|
48 | + foreach ($this->getSubClients() as $client) { |
|
49 | 49 | $view->hiddenBody .= $client->copy(); |
50 | 50 | } |
51 | 51 | |
52 | - return $this->render( $view ); |
|
52 | + return $this->render($view); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -62,20 +62,20 @@ discard block |
||
62 | 62 | { |
63 | 63 | $view = $this->getView(); |
64 | 64 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
65 | - $data = $view->param( 'characteristic/hidden', [] ); |
|
65 | + $data = $view->param('characteristic/hidden', []); |
|
66 | 66 | |
67 | - foreach( $view->value( $data, 'product.lists.id', [] ) as $idx => $value ) { |
|
67 | + foreach ($view->value($data, 'product.lists.id', []) as $idx => $value) { |
|
68 | 68 | $data['product.lists.siteid'][$idx] = $siteid; |
69 | 69 | } |
70 | 70 | |
71 | 71 | $view->hiddenData = $data; |
72 | 72 | $view->hiddenBody = ''; |
73 | 73 | |
74 | - foreach( $this->getSubClients() as $client ) { |
|
74 | + foreach ($this->getSubClients() as $client) { |
|
75 | 75 | $view->hiddenBody .= $client->create(); |
76 | 76 | } |
77 | 77 | |
78 | - return $this->render( $view ); |
|
78 | + return $this->render($view); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | { |
89 | 89 | $view = $this->getView(); |
90 | 90 | |
91 | - $view->hiddenData = $this->toArray( $view->item ); |
|
91 | + $view->hiddenData = $this->toArray($view->item); |
|
92 | 92 | $view->hiddenBody = ''; |
93 | 93 | |
94 | - foreach( $this->getSubClients() as $client ) { |
|
94 | + foreach ($this->getSubClients() as $client) { |
|
95 | 95 | $view->hiddenBody .= $client->get(); |
96 | 96 | } |
97 | 97 | |
98 | - return $this->render( $view ); |
|
98 | + return $this->render($view); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | { |
107 | 107 | $view = $this->getView(); |
108 | 108 | |
109 | - $this->fromArray( $view->item, $view->param( 'characteristic/hidden', [] ) ); |
|
109 | + $this->fromArray($view->item, $view->param('characteristic/hidden', [])); |
|
110 | 110 | $view->hiddenBody = ''; |
111 | 111 | |
112 | - foreach( $this->getSubClients() as $client ) { |
|
112 | + foreach ($this->getSubClients() as $client) { |
|
113 | 113 | $view->hiddenBody .= $client->save(); |
114 | 114 | } |
115 | 115 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @param string|null $name Name of the sub-client (Default if null) |
123 | 123 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
124 | 124 | */ |
125 | - public function getSubClient( $type, $name = null ) |
|
125 | + public function getSubClient($type, $name = null) |
|
126 | 126 | { |
127 | 127 | /** admin/jqadm/product/characteristic/hidden/decorators/excludes |
128 | 128 | * Excludes decorators added by the "common" option from the product JQAdm client |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @see admin/jqadm/product/characteristic/hidden/decorators/excludes |
198 | 198 | * @see admin/jqadm/product/characteristic/hidden/decorators/global |
199 | 199 | */ |
200 | - return $this->createSubClient( 'product/characteristic/hidden/' . $type, $name ); |
|
200 | + return $this->createSubClient('product/characteristic/hidden/' . $type, $name); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * @since 2016.01 |
242 | 242 | * @category Developer |
243 | 243 | */ |
244 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/characteristic/hidden/standard/subparts', [] ); |
|
244 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/characteristic/hidden/standard/subparts', []); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | |
@@ -251,29 +251,29 @@ discard block |
||
251 | 251 | * @param \Aimeos\MShop\Product\Item\Iface $item Product item object without referenced domain items |
252 | 252 | * @param string[] $data Data array |
253 | 253 | */ |
254 | - protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data ) |
|
254 | + protected function fromArray(\Aimeos\MShop\Product\Item\Iface $item, array $data) |
|
255 | 255 | { |
256 | - $listManager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' ); |
|
256 | + $listManager = \Aimeos\MShop::create($this->getContext(), 'product/lists'); |
|
257 | 257 | |
258 | - $listItem = $listManager->createItem()->setType( 'hidden' ); |
|
259 | - $listItems = $item->getListItems( 'attribute', 'hidden', null, false ); |
|
258 | + $listItem = $listManager->createItem()->setType('hidden'); |
|
259 | + $listItems = $item->getListItems('attribute', 'hidden', null, false); |
|
260 | 260 | |
261 | - foreach( $this->getValue( $data, 'product.lists.id', [] ) as $idx => $id ) |
|
261 | + foreach ($this->getValue($data, 'product.lists.id', []) as $idx => $id) |
|
262 | 262 | { |
263 | - if( isset( $listItems[$id] ) ) { |
|
264 | - $litem = $listItems[$id]; unset( $listItems[$id] ); |
|
263 | + if (isset($listItems[$id])) { |
|
264 | + $litem = $listItems[$id]; unset($listItems[$id]); |
|
265 | 265 | } else { |
266 | 266 | $litem = clone $listItem; |
267 | 267 | } |
268 | 268 | |
269 | - $litem->setId( $id ); |
|
270 | - $litem->setPosition( $idx ); |
|
271 | - $litem->setRefId( $this->getValue( $data, 'product.lists.refid/' . $idx ) ); |
|
269 | + $litem->setId($id); |
|
270 | + $litem->setPosition($idx); |
|
271 | + $litem->setRefId($this->getValue($data, 'product.lists.refid/' . $idx)); |
|
272 | 272 | |
273 | - $item->addListItem( 'attribute', $litem, $litem->getRefItem() ); |
|
273 | + $item->addListItem('attribute', $litem, $litem->getRefItem()); |
|
274 | 274 | } |
275 | 275 | |
276 | - return $item->deleteListItems( $listItems ); |
|
276 | + return $item->deleteListItems($listItems); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | |
@@ -284,26 +284,26 @@ discard block |
||
284 | 284 | * @param boolean $copy True if items should be copied, false if not |
285 | 285 | * @return string[] Multi-dimensional associative list of item data |
286 | 286 | */ |
287 | - protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false ) |
|
287 | + protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false) |
|
288 | 288 | { |
289 | 289 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
290 | 290 | $data = []; |
291 | 291 | |
292 | - foreach( $item->getListItems( 'attribute', 'hidden', null, false ) as $listItem ) |
|
292 | + foreach ($item->getListItems('attribute', 'hidden', null, false) as $listItem) |
|
293 | 293 | { |
294 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
294 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
295 | 295 | continue; |
296 | 296 | } |
297 | 297 | |
298 | - $list = $listItem->toArray( true ) + $refItem->toArray( true ); |
|
298 | + $list = $listItem->toArray(true) + $refItem->toArray(true); |
|
299 | 299 | |
300 | - if( $copy === true ) |
|
300 | + if ($copy === true) |
|
301 | 301 | { |
302 | 302 | $list['product.lists.siteid'] = $siteId; |
303 | 303 | $list['product.lists.id'] = ''; |
304 | 304 | } |
305 | 305 | |
306 | - foreach( $list as $key => $value ) { |
|
306 | + foreach ($list as $key => $value) { |
|
307 | 307 | $data[$key][] = $value; |
308 | 308 | } |
309 | 309 | } |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
319 | 319 | * @return string HTML output |
320 | 320 | */ |
321 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
321 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
322 | 322 | { |
323 | 323 | /** admin/jqadm/product/characteristic/hidden/template-item |
324 | 324 | * Relative path to the HTML body template of the hidden characteristic subpart for products. |
@@ -342,6 +342,6 @@ discard block |
||
342 | 342 | $tplconf = 'admin/jqadm/product/characteristic/hidden/template-item'; |
343 | 343 | $default = 'product/item-characteristic-hidden-standard'; |
344 | 344 | |
345 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
345 | + return $view->render($view->config($tplconf, $default)); |
|
346 | 346 | } |
347 | 347 | } |
348 | 348 | \ No newline at end of file |
@@ -42,14 +42,14 @@ discard block |
||
42 | 42 | { |
43 | 43 | $view = $this->getView(); |
44 | 44 | |
45 | - $view->attributeData = $this->toArray( $view->item, true ); |
|
45 | + $view->attributeData = $this->toArray($view->item, true); |
|
46 | 46 | $view->attributeBody = ''; |
47 | 47 | |
48 | - foreach( $this->getSubClients() as $client ) { |
|
48 | + foreach ($this->getSubClients() as $client) { |
|
49 | 49 | $view->attributeBody .= $client->copy(); |
50 | 50 | } |
51 | 51 | |
52 | - return $this->render( $view ); |
|
52 | + return $this->render($view); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -62,20 +62,20 @@ discard block |
||
62 | 62 | { |
63 | 63 | $view = $this->getView(); |
64 | 64 | $siteid = $this->getContext()->getLocale()->getSiteId(); |
65 | - $data = $view->param( 'characteristic/attribute', [] ); |
|
65 | + $data = $view->param('characteristic/attribute', []); |
|
66 | 66 | |
67 | - foreach( $view->value( $data, 'product.lists.id', [] ) as $idx => $value ) { |
|
67 | + foreach ($view->value($data, 'product.lists.id', []) as $idx => $value) { |
|
68 | 68 | $data['product.lists.siteid'][$idx] = $siteid; |
69 | 69 | } |
70 | 70 | |
71 | 71 | $view->attributeData = $data; |
72 | 72 | $view->attributeBody = ''; |
73 | 73 | |
74 | - foreach( $this->getSubClients() as $client ) { |
|
74 | + foreach ($this->getSubClients() as $client) { |
|
75 | 75 | $view->attributeBody .= $client->create(); |
76 | 76 | } |
77 | 77 | |
78 | - return $this->render( $view ); |
|
78 | + return $this->render($view); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | { |
89 | 89 | $view = $this->getView(); |
90 | 90 | |
91 | - $view->attributeData = $this->toArray( $view->item ); |
|
91 | + $view->attributeData = $this->toArray($view->item); |
|
92 | 92 | $view->attributeBody = ''; |
93 | 93 | |
94 | - foreach( $this->getSubClients() as $client ) { |
|
94 | + foreach ($this->getSubClients() as $client) { |
|
95 | 95 | $view->attributeBody .= $client->get(); |
96 | 96 | } |
97 | 97 | |
98 | - return $this->render( $view ); |
|
98 | + return $this->render($view); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | { |
107 | 107 | $view = $this->getView(); |
108 | 108 | |
109 | - $this->fromArray( $view->item, $view->param( 'characteristic/attribute', [] ) ); |
|
109 | + $this->fromArray($view->item, $view->param('characteristic/attribute', [])); |
|
110 | 110 | $view->attributeBody = ''; |
111 | 111 | |
112 | - foreach( $this->getSubClients() as $client ) { |
|
112 | + foreach ($this->getSubClients() as $client) { |
|
113 | 113 | $view->attributeBody .= $client->save(); |
114 | 114 | } |
115 | 115 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @param string|null $name Name of the sub-client (Default if null) |
123 | 123 | * @return \Aimeos\Admin\JQAdm\Iface Sub-client object |
124 | 124 | */ |
125 | - public function getSubClient( $type, $name = null ) |
|
125 | + public function getSubClient($type, $name = null) |
|
126 | 126 | { |
127 | 127 | /** admin/jqadm/product/characteristic/attribute/decorators/excludes |
128 | 128 | * Excludes decorators added by the "common" option from the product JQAdm client |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @see admin/jqadm/product/characteristic/attribute/decorators/excludes |
198 | 198 | * @see admin/jqadm/product/characteristic/attribute/decorators/global |
199 | 199 | */ |
200 | - return $this->createSubClient( 'product/characteristic/attribute/' . $type, $name ); |
|
200 | + return $this->createSubClient('product/characteristic/attribute/' . $type, $name); |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * @since 2016.01 |
242 | 242 | * @category Developer |
243 | 243 | */ |
244 | - return $this->getContext()->getConfig()->get( 'admin/jqadm/product/characteristic/attribute/standard/subparts', [] ); |
|
244 | + return $this->getContext()->getConfig()->get('admin/jqadm/product/characteristic/attribute/standard/subparts', []); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | |
@@ -251,29 +251,29 @@ discard block |
||
251 | 251 | * @param \Aimeos\MShop\Product\Item\Iface $item Product item object without referenced domain items |
252 | 252 | * @param string[] $data Data array |
253 | 253 | */ |
254 | - protected function fromArray( \Aimeos\MShop\Product\Item\Iface $item, array $data ) |
|
254 | + protected function fromArray(\Aimeos\MShop\Product\Item\Iface $item, array $data) |
|
255 | 255 | { |
256 | - $listManager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' ); |
|
256 | + $listManager = \Aimeos\MShop::create($this->getContext(), 'product/lists'); |
|
257 | 257 | |
258 | - $listItem = $listManager->createItem()->setType( 'default' ); |
|
259 | - $listItems = $item->getListItems( 'attribute', 'default', null, false ); |
|
258 | + $listItem = $listManager->createItem()->setType('default'); |
|
259 | + $listItems = $item->getListItems('attribute', 'default', null, false); |
|
260 | 260 | |
261 | - foreach( $this->getValue( $data, 'product.lists.id', [] ) as $idx => $id ) |
|
261 | + foreach ($this->getValue($data, 'product.lists.id', []) as $idx => $id) |
|
262 | 262 | { |
263 | - if( isset( $listItems[$id] ) ) { |
|
264 | - $litem = $listItems[$id]; unset( $listItems[$id] ); |
|
263 | + if (isset($listItems[$id])) { |
|
264 | + $litem = $listItems[$id]; unset($listItems[$id]); |
|
265 | 265 | } else { |
266 | 266 | $litem = clone $listItem; |
267 | 267 | } |
268 | 268 | |
269 | - $litem->setId( $id ); |
|
270 | - $litem->setPosition( $idx ); |
|
271 | - $litem->setRefId( $this->getValue( $data, 'product.lists.refid/' . $idx ) ); |
|
269 | + $litem->setId($id); |
|
270 | + $litem->setPosition($idx); |
|
271 | + $litem->setRefId($this->getValue($data, 'product.lists.refid/' . $idx)); |
|
272 | 272 | |
273 | - $item->addListItem( 'attribute', $litem, $litem->getRefItem() ); |
|
273 | + $item->addListItem('attribute', $litem, $litem->getRefItem()); |
|
274 | 274 | } |
275 | 275 | |
276 | - return $item->deleteListItems( $listItems ); |
|
276 | + return $item->deleteListItems($listItems); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | |
@@ -284,26 +284,26 @@ discard block |
||
284 | 284 | * @param boolean $copy True if items should be copied, false if not |
285 | 285 | * @return string[] Multi-dimensional associative list of item data |
286 | 286 | */ |
287 | - protected function toArray( \Aimeos\MShop\Product\Item\Iface $item, $copy = false ) |
|
287 | + protected function toArray(\Aimeos\MShop\Product\Item\Iface $item, $copy = false) |
|
288 | 288 | { |
289 | 289 | $data = []; |
290 | 290 | $siteId = $this->getContext()->getLocale()->getSiteId(); |
291 | 291 | |
292 | - foreach( $item->getListItems( 'attribute', 'default', null, false ) as $listItem ) |
|
292 | + foreach ($item->getListItems('attribute', 'default', null, false) as $listItem) |
|
293 | 293 | { |
294 | - if( ( $refItem = $listItem->getRefItem() ) === null ) { |
|
294 | + if (($refItem = $listItem->getRefItem()) === null) { |
|
295 | 295 | continue; |
296 | 296 | } |
297 | 297 | |
298 | - $list = $listItem->toArray( true ) + $refItem->toArray( true ); |
|
298 | + $list = $listItem->toArray(true) + $refItem->toArray(true); |
|
299 | 299 | |
300 | - if( $copy === true ) |
|
300 | + if ($copy === true) |
|
301 | 301 | { |
302 | 302 | $list['product.lists.siteid'] = $siteId; |
303 | 303 | $list['product.lists.id'] = ''; |
304 | 304 | } |
305 | 305 | |
306 | - foreach( $list as $key => $value ) { |
|
306 | + foreach ($list as $key => $value) { |
|
307 | 307 | $data[$key][] = $value; |
308 | 308 | } |
309 | 309 | } |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * @param \Aimeos\MW\View\Iface $view View object with data assigned |
319 | 319 | * @return string HTML output |
320 | 320 | */ |
321 | - protected function render( \Aimeos\MW\View\Iface $view ) |
|
321 | + protected function render(\Aimeos\MW\View\Iface $view) |
|
322 | 322 | { |
323 | 323 | /** admin/jqadm/product/characteristic/attribute/template-item |
324 | 324 | * Relative path to the HTML body template of the attribute characteristic subpart for products. |
@@ -342,6 +342,6 @@ discard block |
||
342 | 342 | $tplconf = 'admin/jqadm/product/characteristic/attribute/template-item'; |
343 | 343 | $default = 'product/item-characteristic-attribute-standard'; |
344 | 344 | |
345 | - return $view->render( $view->config( $tplconf, $default ) ); |
|
345 | + return $view->render($view->config($tplconf, $default)); |
|
346 | 346 | } |
347 | 347 | } |
348 | 348 | \ No newline at end of file |