@@ -33,10 +33,10 @@ discard block |
||
| 33 | 33 | * @param array $templatePaths List of file system paths where the templates are stored |
| 34 | 34 | * @param string $path Name of the client separated by slashes, e.g "product/stock" |
| 35 | 35 | */ |
| 36 | - public function __construct( \Aimeos\Admin\JsonAdm\Iface $client, |
|
| 37 | - \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MW\View\Iface $view, array $templatePaths, $path ) |
|
| 36 | + public function __construct(\Aimeos\Admin\JsonAdm\Iface $client, |
|
| 37 | + \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MW\View\Iface $view, array $templatePaths, $path) |
|
| 38 | 38 | { |
| 39 | - parent::__construct( $context, $view, $templatePaths, $path ); |
|
| 39 | + parent::__construct($context, $view, $templatePaths, $path); |
|
| 40 | 40 | |
| 41 | 41 | $this->client = $client; |
| 42 | 42 | } |
@@ -50,10 +50,10 @@ discard block |
||
| 50 | 50 | * @return mixed Returns the value of the called method |
| 51 | 51 | * @throws \Aimeos\Admin\JsonAdm\Exception If method call failed |
| 52 | 52 | */ |
| 53 | - public function __call( $name, array $param ) |
|
| 53 | + public function __call($name, array $param) |
|
| 54 | 54 | { |
| 55 | - if( ( $result = call_user_func_array( array( $this->client, $name ), $param ) ) === false ) { |
|
| 56 | - throw new \Aimeos\Admin\JsonAdm\Exception( sprintf( 'Unable to call method "%1$s"', $name ) ); |
|
| 55 | + if (($result = call_user_func_array(array($this->client, $name), $param)) === false) { |
|
| 56 | + throw new \Aimeos\Admin\JsonAdm\Exception(sprintf('Unable to call method "%1$s"', $name)); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | return $result; |
@@ -68,9 +68,9 @@ discard block |
||
| 68 | 68 | * @param integer &$status Variable which contains the HTTP status afterwards |
| 69 | 69 | * @return string Content for response body |
| 70 | 70 | */ |
| 71 | - public function delete( $body, array &$header, &$status ) |
|
| 71 | + public function delete($body, array &$header, &$status) |
|
| 72 | 72 | { |
| 73 | - return $this->client->delete( $body, $header, $status ); |
|
| 73 | + return $this->client->delete($body, $header, $status); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | * @param integer &$status Variable which contains the HTTP status afterwards |
| 83 | 83 | * @return string Content for response body |
| 84 | 84 | */ |
| 85 | - public function get( $body, array &$header, &$status ) |
|
| 85 | + public function get($body, array &$header, &$status) |
|
| 86 | 86 | { |
| 87 | - return $this->client->get( $body, $header, $status ); |
|
| 87 | + return $this->client->get($body, $header, $status); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
@@ -97,9 +97,9 @@ discard block |
||
| 97 | 97 | * @param integer &$status Variable which contains the HTTP status afterwards |
| 98 | 98 | * @return string Content for response body |
| 99 | 99 | */ |
| 100 | - public function patch( $body, array &$header, &$status ) |
|
| 100 | + public function patch($body, array &$header, &$status) |
|
| 101 | 101 | { |
| 102 | - return $this->client->patch( $body, $header, $status ); |
|
| 102 | + return $this->client->patch($body, $header, $status); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | |
@@ -112,9 +112,9 @@ discard block |
||
| 112 | 112 | * @param integer &$status Variable which contains the HTTP status afterwards |
| 113 | 113 | * @return string Content for response body |
| 114 | 114 | */ |
| 115 | - public function post( $body, array &$header, &$status ) |
|
| 115 | + public function post($body, array &$header, &$status) |
|
| 116 | 116 | { |
| 117 | - return $this->client->post( $body, $header, $status ); |
|
| 117 | + return $this->client->post($body, $header, $status); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | |
@@ -127,9 +127,9 @@ discard block |
||
| 127 | 127 | * @param integer &$status Variable which contains the HTTP status afterwards |
| 128 | 128 | * @return string Content for response body |
| 129 | 129 | */ |
| 130 | - public function put( $body, array &$header, &$status ) |
|
| 130 | + public function put($body, array &$header, &$status) |
|
| 131 | 131 | { |
| 132 | - return $this->client->put( $body, $header, $status ); |
|
| 132 | + return $this->client->put($body, $header, $status); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | * @param integer &$status Variable which contains the HTTP status afterwards |
| 143 | 143 | * @return string Content for response body |
| 144 | 144 | */ |
| 145 | - public function options( $body, array &$header, &$status ) |
|
| 145 | + public function options($body, array &$header, &$status) |
|
| 146 | 146 | { |
| 147 | - return $this->client->options( $body, $header, $status ); |
|
| 147 | + return $this->client->options($body, $header, $status); |
|
| 148 | 148 | } |
| 149 | 149 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | * @param integer &$status Variable which contains the HTTP status afterwards |
| 109 | 109 | * @return string Content for response body |
| 110 | 110 | */ |
| 111 | - public function get( $body, array &$header, &$status ) |
|
| 111 | + public function get($body, array &$header, &$status) |
|
| 112 | 112 | { |
| 113 | 113 | /** admin/jsonadm/partials/order/template-data |
| 114 | 114 | * Relative path to the data partial template file for the order client |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | * @since 2016.01 |
| 126 | 126 | * @category Developer |
| 127 | 127 | */ |
| 128 | - $this->getView()->assign( array( 'partial-data' => 'admin/jsonadm/partials/order/template-data' ) ); |
|
| 128 | + $this->getView()->assign(array('partial-data' => 'admin/jsonadm/partials/order/template-data')); |
|
| 129 | 129 | |
| 130 | - return parent::get( $body, $header, $status ); |
|
| 130 | + return parent::get($body, $header, $status); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
@@ -138,35 +138,35 @@ discard block |
||
| 138 | 138 | * @param array $include List of resource types that should be fetched |
| 139 | 139 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Iface |
| 140 | 140 | */ |
| 141 | - protected function getChildItems( array $items, array $include ) |
|
| 141 | + protected function getChildItems(array $items, array $include) |
|
| 142 | 142 | { |
| 143 | 143 | $list = array(); |
| 144 | 144 | |
| 145 | - if( in_array( 'order/base', $include ) ) |
|
| 145 | + if (in_array('order/base', $include)) |
|
| 146 | 146 | { |
| 147 | 147 | $ids = array(); |
| 148 | 148 | |
| 149 | - foreach( $items as $item ) { |
|
| 149 | + foreach ($items as $item) { |
|
| 150 | 150 | $ids[] = $item->getBaseId(); |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order/base' ); |
|
| 153 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'order/base'); |
|
| 154 | 154 | |
| 155 | 155 | $search = $manager->createSearch(); |
| 156 | - $search->setConditions( $search->compare( '==', 'order.base.id', $ids ) ); |
|
| 156 | + $search->setConditions($search->compare('==', 'order.base.id', $ids)); |
|
| 157 | 157 | |
| 158 | - $list = array_merge( $list, $manager->searchItems( $search ) ); |
|
| 158 | + $list = array_merge($list, $manager->searchItems($search)); |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - if( in_array( 'order/status', $include ) ) |
|
| 161 | + if (in_array('order/status', $include)) |
|
| 162 | 162 | { |
| 163 | - $ids = array_keys( $items ); |
|
| 164 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order/status' ); |
|
| 163 | + $ids = array_keys($items); |
|
| 164 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'order/status'); |
|
| 165 | 165 | |
| 166 | 166 | $search = $manager->createSearch(); |
| 167 | - $search->setConditions( $search->compare( '==', 'order.status.parentid', $ids ) ); |
|
| 167 | + $search->setConditions($search->compare('==', 'order.status.parentid', $ids)); |
|
| 168 | 168 | |
| 169 | - $list = array_merge( $list, $manager->searchItems( $search ) ); |
|
| 169 | + $list = array_merge($list, $manager->searchItems($search)); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | return $list; |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | * @param integer &$status Variable which contains the HTTP status afterwards |
| 109 | 109 | * @return string Content for response body |
| 110 | 110 | */ |
| 111 | - public function get( $body, array &$header, &$status ) |
|
| 111 | + public function get($body, array &$header, &$status) |
|
| 112 | 112 | { |
| 113 | 113 | /** admin/jsonadm/partials/order/base/template-data |
| 114 | 114 | * Relative path to the data partial template file for the order base client |
@@ -125,9 +125,9 @@ discard block |
||
| 125 | 125 | * @since 2016.01 |
| 126 | 126 | * @category Developer |
| 127 | 127 | */ |
| 128 | - $this->getView()->assign( array( 'partial-data' => 'admin/jsonadm/partials/order/base/template-data' ) ); |
|
| 128 | + $this->getView()->assign(array('partial-data' => 'admin/jsonadm/partials/order/base/template-data')); |
|
| 129 | 129 | |
| 130 | - return parent::get( $body, $header, $status ); |
|
| 130 | + return parent::get($body, $header, $status); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
@@ -138,21 +138,21 @@ discard block |
||
| 138 | 138 | * @param array $include List of resource types that should be fetched |
| 139 | 139 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Iface |
| 140 | 140 | */ |
| 141 | - protected function getChildItems( array $items, array $include ) |
|
| 141 | + protected function getChildItems(array $items, array $include) |
|
| 142 | 142 | { |
| 143 | 143 | $list = array(); |
| 144 | - $ids = array_keys( $items ); |
|
| 145 | - $keys = array( 'order/base/address', 'order/base/coupon', 'order/base/product', 'order/base/service' ); |
|
| 146 | - $include = array_intersect( $include, $keys ); |
|
| 144 | + $ids = array_keys($items); |
|
| 145 | + $keys = array('order/base/address', 'order/base/coupon', 'order/base/product', 'order/base/service'); |
|
| 146 | + $include = array_intersect($include, $keys); |
|
| 147 | 147 | |
| 148 | - foreach( $include as $type ) |
|
| 148 | + foreach ($include as $type) |
|
| 149 | 149 | { |
| 150 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), $type ); |
|
| 150 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), $type); |
|
| 151 | 151 | |
| 152 | 152 | $search = $manager->createSearch(); |
| 153 | - $search->setConditions( $search->compare( '==', str_replace( '/', '.', $type ) . '.baseid', $ids ) ); |
|
| 153 | + $search->setConditions($search->compare('==', str_replace('/', '.', $type) . '.baseid', $ids)); |
|
| 154 | 154 | |
| 155 | - $list = array_merge( $list, $manager->searchItems( $search ) ); |
|
| 155 | + $list = array_merge($list, $manager->searchItems($search)); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | return $list; |
@@ -107,17 +107,17 @@ |
||
| 107 | 107 | * @param array $include List of resource types that should be fetched |
| 108 | 108 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface |
| 109 | 109 | */ |
| 110 | - protected function getListItems( array $items, array $include ) |
|
| 110 | + protected function getListItems(array $items, array $include) |
|
| 111 | 111 | { |
| 112 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'text/lists' ); |
|
| 112 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'text/lists'); |
|
| 113 | 113 | |
| 114 | 114 | $search = $manager->createSearch(); |
| 115 | 115 | $expr = array( |
| 116 | - $search->compare( '==', 'text.lists.parentid', array_keys( $items ) ), |
|
| 117 | - $search->compare( '==', 'text.lists.domain', $include ), |
|
| 116 | + $search->compare('==', 'text.lists.parentid', array_keys($items)), |
|
| 117 | + $search->compare('==', 'text.lists.domain', $include), |
|
| 118 | 118 | ); |
| 119 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 119 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 120 | 120 | |
| 121 | - return $manager->searchItems( $search ); |
|
| 121 | + return $manager->searchItems($search); |
|
| 122 | 122 | } |
| 123 | 123 | } |
@@ -107,17 +107,17 @@ |
||
| 107 | 107 | * @param array $include List of resource types that should be fetched |
| 108 | 108 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface |
| 109 | 109 | */ |
| 110 | - protected function getListItems( array $items, array $include ) |
|
| 110 | + protected function getListItems(array $items, array $include) |
|
| 111 | 111 | { |
| 112 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'price/lists' ); |
|
| 112 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'price/lists'); |
|
| 113 | 113 | |
| 114 | 114 | $search = $manager->createSearch(); |
| 115 | 115 | $expr = array( |
| 116 | - $search->compare( '==', 'price.lists.parentid', array_keys( $items ) ), |
|
| 117 | - $search->compare( '==', 'price.lists.domain', $include ), |
|
| 116 | + $search->compare('==', 'price.lists.parentid', array_keys($items)), |
|
| 117 | + $search->compare('==', 'price.lists.domain', $include), |
|
| 118 | 118 | ); |
| 119 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 119 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 120 | 120 | |
| 121 | - return $manager->searchItems( $search ); |
|
| 121 | + return $manager->searchItems($search); |
|
| 122 | 122 | } |
| 123 | 123 | } |
@@ -107,17 +107,17 @@ |
||
| 107 | 107 | * @param array $include List of resource types that should be fetched |
| 108 | 108 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface |
| 109 | 109 | */ |
| 110 | - protected function getListItems( array $items, array $include ) |
|
| 110 | + protected function getListItems(array $items, array $include) |
|
| 111 | 111 | { |
| 112 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'attribute/lists' ); |
|
| 112 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'attribute/lists'); |
|
| 113 | 113 | |
| 114 | 114 | $search = $manager->createSearch(); |
| 115 | 115 | $expr = array( |
| 116 | - $search->compare( '==', 'attribute.lists.parentid', array_keys( $items ) ), |
|
| 117 | - $search->compare( '==', 'attribute.lists.domain', $include ), |
|
| 116 | + $search->compare('==', 'attribute.lists.parentid', array_keys($items)), |
|
| 117 | + $search->compare('==', 'attribute.lists.domain', $include), |
|
| 118 | 118 | ); |
| 119 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 119 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 120 | 120 | |
| 121 | - return $manager->searchItems( $search ); |
|
| 121 | + return $manager->searchItems($search); |
|
| 122 | 122 | } |
| 123 | 123 | } |
@@ -107,17 +107,17 @@ |
||
| 107 | 107 | * @param array $include List of resource types that should be fetched |
| 108 | 108 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface |
| 109 | 109 | */ |
| 110 | - protected function getListItems( array $items, array $include ) |
|
| 110 | + protected function getListItems(array $items, array $include) |
|
| 111 | 111 | { |
| 112 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service/lists' ); |
|
| 112 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service/lists'); |
|
| 113 | 113 | |
| 114 | 114 | $search = $manager->createSearch(); |
| 115 | 115 | $expr = array( |
| 116 | - $search->compare( '==', 'service.lists.parentid', array_keys( $items ) ), |
|
| 117 | - $search->compare( '==', 'service.lists.domain', $include ), |
|
| 116 | + $search->compare('==', 'service.lists.parentid', array_keys($items)), |
|
| 117 | + $search->compare('==', 'service.lists.domain', $include), |
|
| 118 | 118 | ); |
| 119 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 119 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 120 | 120 | |
| 121 | - return $manager->searchItems( $search ); |
|
| 121 | + return $manager->searchItems($search); |
|
| 122 | 122 | } |
| 123 | 123 | } |
@@ -107,17 +107,17 @@ |
||
| 107 | 107 | * @param array $include List of resource types that should be fetched |
| 108 | 108 | * @return array List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface |
| 109 | 109 | */ |
| 110 | - protected function getListItems( array $items, array $include ) |
|
| 110 | + protected function getListItems(array $items, array $include) |
|
| 111 | 111 | { |
| 112 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'media/lists' ); |
|
| 112 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'media/lists'); |
|
| 113 | 113 | |
| 114 | 114 | $search = $manager->createSearch(); |
| 115 | 115 | $expr = array( |
| 116 | - $search->compare( '==', 'media.lists.parentid', array_keys( $items ) ), |
|
| 117 | - $search->compare( '==', 'media.lists.domain', $include ), |
|
| 116 | + $search->compare('==', 'media.lists.parentid', array_keys($items)), |
|
| 117 | + $search->compare('==', 'media.lists.domain', $include), |
|
| 118 | 118 | ); |
| 119 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
| 119 | + $search->setConditions($search->combine('&&', $expr)); |
|
| 120 | 120 | |
| 121 | - return $manager->searchItems( $search ); |
|
| 121 | + return $manager->searchItems($search); |
|
| 122 | 122 | } |
| 123 | 123 | } |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | $options = 0; |
| 4 | -if( defined( 'JSON_PRETTY_PRINT' ) ) { |
|
| 4 | +if (defined('JSON_PRETTY_PRINT')) { |
|
| 5 | 5 | $options = JSON_PRETTY_PRINT; |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | 8 | |
| 9 | -echo json_encode( $this->get( 'errors', array() ), $options ); |
|
| 10 | 9 | \ No newline at end of file |
| 10 | +echo json_encode($this->get('errors', array()), $options); |
|
| 11 | 11 | \ No newline at end of file |