@@ -163,8 +163,7 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | $tplconf = 'admin/jsonadm/template-aggregate'; |
| 165 | 165 | $default = 'aggregate-standard'; |
| 166 | - } |
|
| 167 | - else |
|
| 166 | + } else |
|
| 168 | 167 | { |
| 169 | 168 | /** admin/jsonadm/template-get |
| 170 | 169 | * Relative path to the JSON API template for GET requests |
@@ -519,8 +518,7 @@ discard block |
||
| 519 | 518 | $ids = map( $payload->data )->col( 'id' ); |
| 520 | 519 | $manager->delete( $ids->toArray() ); |
| 521 | 520 | $view->total = count( $ids ); |
| 522 | - } |
|
| 523 | - else |
|
| 521 | + } else |
|
| 524 | 522 | { |
| 525 | 523 | $manager->delete( $id ); |
| 526 | 524 | $view->total = 1; |
@@ -558,8 +556,7 @@ discard block |
||
| 558 | 556 | $view->data = $manager->search( $search, $include, $total ); |
| 559 | 557 | $view->childItems = $this->getChildItems( $view->data, $include ); |
| 560 | 558 | $view->listItems = $this->getListItems( $view->data, $include ); |
| 561 | - } |
|
| 562 | - else |
|
| 559 | + } else |
|
| 563 | 560 | { |
| 564 | 561 | $view->data = $manager->get( $id, $include ); |
| 565 | 562 | $view->childItems = $this->getChildItems( map( [$id => $view->data] ), $include ); |
@@ -599,16 +596,14 @@ discard block |
||
| 599 | 596 | $view->data = $data; |
| 600 | 597 | $view->total = count( $data ); |
| 601 | 598 | $response = $response->withHeader( 'Content-Type', 'application/vnd.api+json; ext="bulk"; supported-ext="bulk"' ); |
| 602 | - } |
|
| 603 | - elseif( ( $id = $view->param( 'id' ) ) != null ) |
|
| 599 | + } elseif( ( $id = $view->param( 'id' ) ) != null ) |
|
| 604 | 600 | { |
| 605 | 601 | $payload->data->id = $id; |
| 606 | 602 | $data = $this->saveEntry( $manager, $payload->data ); |
| 607 | 603 | |
| 608 | 604 | $view->data = $data; |
| 609 | 605 | $view->total = 1; |
| 610 | - } |
|
| 611 | - else |
|
| 606 | + } else |
|
| 612 | 607 | { |
| 613 | 608 | throw new \Aimeos\Admin\JsonAdm\Exception( sprintf( 'No ID given' ), 400 ); |
| 614 | 609 | } |
@@ -647,8 +642,7 @@ discard block |
||
| 647 | 642 | $view->data = $data; |
| 648 | 643 | $view->total = count( $data ); |
| 649 | 644 | $response = $response->withHeader( 'Content-Type', 'application/vnd.api+json; ext="bulk"; supported-ext="bulk"' ); |
| 650 | - } |
|
| 651 | - else |
|
| 645 | + } else |
|
| 652 | 646 | { |
| 653 | 647 | $payload->data->id = null; |
| 654 | 648 | $data = $this->saveEntry( $manager, $payload->data ); |
@@ -182,8 +182,7 @@ discard block |
||
| 182 | 182 | $view->data = $manager->search( $search, $include, $total ); |
| 183 | 183 | $view->listItems = $this->getListItems( $view->data, $include ); |
| 184 | 184 | $view->childItems = map(); |
| 185 | - } |
|
| 186 | - else |
|
| 185 | + } else |
|
| 187 | 186 | { |
| 188 | 187 | $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE; |
| 189 | 188 | if( in_array( 'catalog', $include ) ) { |
@@ -240,8 +239,7 @@ discard block |
||
| 240 | 239 | if( isset( $entry->parentid ) && $targetId !== null ) { |
| 241 | 240 | $manager->move( $item->getId(), $entry->parentid, $targetId, $refId ); |
| 242 | 241 | } |
| 243 | - } |
|
| 244 | - else |
|
| 242 | + } else |
|
| 245 | 243 | { |
| 246 | 244 | $item = $manager->create(); |
| 247 | 245 | |
@@ -160,8 +160,7 @@ discard block |
||
| 160 | 160 | $search->add( $search->is( 'locale.site.id', '==', $id ) )->slice( 0, 1 ); |
| 161 | 161 | $view->data = $manager->search( $search, [], $total ) |
| 162 | 162 | ->first( new \Aimeos\MShop\Exception( $view->translate( 'admin', 'Item not available' ) ) ); |
| 163 | - } |
|
| 164 | - else |
|
| 163 | + } else |
|
| 165 | 164 | { |
| 166 | 165 | $view->data = $manager->search( $search, [], $total ); |
| 167 | 166 | } |
@@ -193,8 +192,7 @@ discard block |
||
| 193 | 192 | } |
| 194 | 193 | |
| 195 | 194 | $item = $manager->save( $item ); |
| 196 | - } |
|
| 197 | - else |
|
| 195 | + } else |
|
| 198 | 196 | { |
| 199 | 197 | $item = $manager->create(); |
| 200 | 198 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * Sets the Aimeos bootstrap object |
| 71 | 71 | * |
| 72 | 72 | * @param \Aimeos\Bootstrap $aimeos The Aimeos bootstrap object |
| 73 | - * @return \Aimeos\Admin\JsonAdm\Iface Reference to this object for fluent calls |
|
| 73 | + * @return Base Reference to this object for fluent calls |
|
| 74 | 74 | */ |
| 75 | 75 | public function setAimeos( \Aimeos\Bootstrap $aimeos ) : \Aimeos\Admin\JsonAdm\Iface |
| 76 | 76 | { |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * Sets the view object that will generate the admin output. |
| 99 | 99 | * |
| 100 | 100 | * @param \Aimeos\MW\View\Iface $view The view object which generates the admin output |
| 101 | - * @return \Aimeos\Admin\JsonAdm\Iface Reference to this object for fluent calls |
|
| 101 | + * @return Base Reference to this object for fluent calls |
|
| 102 | 102 | */ |
| 103 | 103 | public function setView( \Aimeos\MW\View\Iface $view ) : \Aimeos\Admin\JsonAdm\Iface |
| 104 | 104 | { |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | * |
| 171 | 171 | * @param \Aimeos\Map $items List of items implementing \Aimeos\MShop\Common\Item\Iface |
| 172 | 172 | * @param array $include List of resource types that should be fetched |
| 173 | - * @return array List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface |
|
| 173 | + * @return \Aimeos\Map List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface |
|
| 174 | 174 | */ |
| 175 | 175 | protected function getListItems( \Aimeos\Map $items, array $include ) : \Aimeos\Map |
| 176 | 176 | { |
@@ -26,6 +26,7 @@ |
||
| 26 | 26 | * @param \Aimeos\Admin\JsonAdm\Iface $client Client object |
| 27 | 27 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects |
| 28 | 28 | * @param string $path Name of the client separated by slashes, e.g "product/stock" |
| 29 | + * @return void |
|
| 29 | 30 | */ |
| 30 | 31 | public function __construct( \Aimeos\Admin\JsonAdm\Iface $client, \Aimeos\MShop\Context\Item\Iface $context, string $path ); |
| 31 | 32 | } |
@@ -25,6 +25,7 @@ |
||
| 25 | 25 | * |
| 26 | 26 | * @param \Aimeos\MShop\Context\Item\Iface $context MShop context object |
| 27 | 27 | * @param string $path Name of the client separated by slashes, e.g "order/base" |
| 28 | + * @return void |
|
| 28 | 29 | */ |
| 29 | 30 | public function __construct( \Aimeos\MShop\Context\Item\Iface $context, string $path ); |
| 30 | 31 | } |
@@ -77,7 +77,6 @@ |
||
| 77 | 77 | * |
| 78 | 78 | * @param \Psr\Http\Message\ServerRequestInterface $request Request object |
| 79 | 79 | * @param \Psr\Http\Message\ResponseInterface $response Response object |
| 80 | - * @param string|null $prefix Form parameter prefix when nesting parameters is required |
|
| 81 | 80 | * @return \Psr\Http\Message\ResponseInterface Modified response object |
| 82 | 81 | */ |
| 83 | 82 | public function options( ServerRequestInterface $request, ResponseInterface $response ) : \Psr\Http\Message\ResponseInterface; |
@@ -152,6 +152,9 @@ |
||
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | |
| 155 | + /** |
|
| 156 | + * @param string $code |
|
| 157 | + */ |
|
| 155 | 158 | protected function getCatalogItem( $code ) |
| 156 | 159 | { |
| 157 | 160 | $manager = \Aimeos\MShop::create( $this->context, 'catalog' ); |
@@ -98,6 +98,9 @@ |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
| 101 | + /** |
|
| 102 | + * @param string $name |
|
| 103 | + */ |
|
| 101 | 104 | protected function access( $name ) |
| 102 | 105 | { |
| 103 | 106 | $class = new \ReflectionClass( \Aimeos\Admin\JsonAdm\Common\Decorator\Base::class ); |