@@ -147,7 +147,7 @@ |
||
| 147 | 147 | $result = $query->getResult($query::HYDRATE_SCALAR); |
| 148 | 148 | |
| 149 | 149 | return array_map( |
| 150 | - function ($row) { |
|
| 150 | + function($row) { |
|
| 151 | 151 | return $row['connectCategoryId']; |
| 152 | 152 | }, |
| 153 | 153 | $result |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public function hasCategoryChildren($categoryId) |
| 112 | 112 | { |
| 113 | - return (bool) $this->categoryRepository->getChildrenCountList($categoryId); |
|
| 113 | + return (bool)$this->categoryRepository->getChildrenCountList($categoryId); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | public function assignCategoryToArticles($categoryId, array $articleIds) |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | // cast all items in $articleIds to int |
| 161 | 161 | // before use them in WHERE IN clause |
| 162 | 162 | foreach ($articleIds as $key => $articleId) { |
| 163 | - $articleIds[$key] = (int) $articleId; |
|
| 163 | + $articleIds[$key] = (int)$articleId; |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | $connection = $this->manager->getConnection(); |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | WHERE sac.categoryID = :categoryId AND saa.connect_mapped_category = 1'; |
| 197 | 197 | $rows = $connection->fetchAll($sql, [':categoryId' => $localCategoryId]); |
| 198 | 198 | |
| 199 | - return array_map(function ($row) { |
|
| 199 | + return array_map(function($row) { |
|
| 200 | 200 | return $row['articleID']; |
| 201 | 201 | }, $rows); |
| 202 | 202 | } |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | public function importRemoteCategoryCreateLocalCategories($localCategoryId, $remoteCategoryKey, $remoteCategoryLabel, $shopId = null, $stream = null) |
| 235 | 235 | { |
| 236 | 236 | /** @var \Shopware\Models\Category\Category $localCategory */ |
| 237 | - $localCategory = $this->categoryRepository->find((int) $localCategoryId); |
|
| 237 | + $localCategory = $this->categoryRepository->find((int)$localCategoryId); |
|
| 238 | 238 | if (!$localCategory) { |
| 239 | 239 | throw new \RuntimeException('Local category not found!'); |
| 240 | 240 | } |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | WHERE attr.connect_imported_category = 1 AND sac.articleID IN (' . implode(', ', $currentIdBatch) . ') GROUP BY sac.categoryID'; |
| 331 | 331 | $rows = $this->manager->getConnection()->fetchAll($sql); |
| 332 | 332 | |
| 333 | - $remoteCategoryIds = array_merge($remoteCategoryIds, array_map(function ($row) { |
|
| 333 | + $remoteCategoryIds = array_merge($remoteCategoryIds, array_map(function($row) { |
|
| 334 | 334 | return $row['categoryID']; |
| 335 | 335 | }, $rows)); |
| 336 | 336 | } |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | ["%|$categoryId|%"]); |
| 529 | 529 | |
| 530 | 530 | while ($childCategory = $childCategories->fetchColumn()) { |
| 531 | - $categories[] = (int) $childCategory; |
|
| 531 | + $categories[] = (int)$childCategory; |
|
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | $categoriesStatement = $this->manager->getConnection()->prepare('DELETE FROM s_articles_categories WHERE articleID IN (' . implode(', ', $articleIds) . ') AND categoryID IN (' . implode(', ', $categories) . ')'); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | public function getImportedProductCategoriesTreeAction() |
| 51 | 51 | { |
| 52 | 52 | $parent = $this->request->getParam('categoryId', 'root'); |
| 53 | - $hideMapped = (bool) $this->request->getParam('hideMappedProducts', false); |
|
| 53 | + $hideMapped = (bool)$this->request->getParam('hideMappedProducts', false); |
|
| 54 | 54 | |
| 55 | 55 | $query = $this->request->getParam('remoteCategoriesQuery', ''); |
| 56 | 56 | $node = $this->request->getParam('id'); |
@@ -110,9 +110,9 @@ discard block |
||
| 110 | 110 | { |
| 111 | 111 | $category = $this->request->getParam('category', null); |
| 112 | 112 | $shopId = $this->request->getParam('shopId', 0); |
| 113 | - $limit = (int) $this->request->getParam('limit', 10); |
|
| 114 | - $offset = (int) $this->request->getParam('start', 0); |
|
| 115 | - $hideMapped = (bool) $this->request->getParam('hideMappedProducts', false); |
|
| 113 | + $limit = (int)$this->request->getParam('limit', 10); |
|
| 114 | + $offset = (int)$this->request->getParam('start', 0); |
|
| 115 | + $hideMapped = (bool)$this->request->getParam('hideMappedProducts', false); |
|
| 116 | 116 | $searchQuery = $this->request->getParam('remoteArticlesQuery', ''); |
| 117 | 117 | |
| 118 | 118 | $stream = $this->request->getParam('stream', null); |
@@ -153,9 +153,9 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | public function loadBothArticleTypesAction() |
| 155 | 155 | { |
| 156 | - $categoryId = (int) $this->request->getParam('categoryId', 0); |
|
| 157 | - $limit = (int) $this->request->getParam('limit', 10); |
|
| 158 | - $offset = (int) $this->request->getParam('start', 0); |
|
| 156 | + $categoryId = (int)$this->request->getParam('categoryId', 0); |
|
| 157 | + $limit = (int)$this->request->getParam('limit', 10); |
|
| 158 | + $offset = (int)$this->request->getParam('start', 0); |
|
| 159 | 159 | $showOnlyConnectArticles = $this->request->getParam('showOnlyConnectArticles', null); |
| 160 | 160 | $query = $this->request->getParam('localArticlesQuery', ''); |
| 161 | 161 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | public function assignArticlesToCategoryAction() |
| 178 | 178 | { |
| 179 | - $categoryId = (int) $this->request->getParam('categoryId', 0); |
|
| 179 | + $categoryId = (int)$this->request->getParam('categoryId', 0); |
|
| 180 | 180 | $articleIds = $this->request->getParam('articleIds', []); |
| 181 | 181 | |
| 182 | 182 | $snippets = Shopware()->Snippets()->getNamespace('backend/connect/view/main'); |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | public function unassignRemoteArticlesFromLocalCategoryAction() |
| 235 | 235 | { |
| 236 | 236 | $articleIds = $this->request->getParam('articleIds', []); |
| 237 | - $categoryId = (int) $this->request->getParam('categoryId'); |
|
| 237 | + $categoryId = (int)$this->request->getParam('categoryId'); |
|
| 238 | 238 | try { |
| 239 | 239 | $this->getImportService()->unAssignArticleCategories($articleIds, $categoryId); |
| 240 | 240 | } catch (\Exception $e) { |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | public function assignRemoteToLocalCategoryAction() |
| 256 | 256 | { |
| 257 | - $localCategoryId = (int) $this->request->getParam('localCategoryId', 0); |
|
| 257 | + $localCategoryId = (int)$this->request->getParam('localCategoryId', 0); |
|
| 258 | 258 | $remoteCategoryKey = $this->request->getParam('remoteCategoryKey', null); |
| 259 | 259 | $remoteCategoryLabel = $this->request->getParam('remoteCategoryLabel', null); |
| 260 | 260 | $node = $this->request->getParam('node', null); |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | public function getArticleCountForRemoteCategoryAction() |
| 311 | 311 | { |
| 312 | 312 | $remoteCategoryKey = $this->request->getParam('remoteCategoryKey', ""); |
| 313 | - $shopId = (int) $this->request->getParam('shopId', 0); |
|
| 313 | + $shopId = (int)$this->request->getParam('shopId', 0); |
|
| 314 | 314 | |
| 315 | 315 | try { |
| 316 | 316 | $articleCount = $this->getImportService()->importRemoteCategoryGetArticleCountForCategory($shopId, $remoteCategoryKey); |
@@ -326,18 +326,18 @@ discard block |
||
| 326 | 326 | |
| 327 | 327 | $this->View()->assign([ |
| 328 | 328 | 'success' => true, |
| 329 | - 'count' => (int) $articleCount |
|
| 329 | + 'count' => (int)$articleCount |
|
| 330 | 330 | ]); |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | public function assignArticlesToRemoteCategoryAction() |
| 334 | 334 | { |
| 335 | 335 | $remoteCategoryKey = $this->request->getParam('remoteCategoryKey', ""); |
| 336 | - $localCategoryId = (int) $this->request->getParam('localCategoryId', 0); |
|
| 337 | - $localParentId = (int) $this->request->getParam('localParentId', 0); |
|
| 338 | - $offset = (int) $this->request->getParam('offset', 0); |
|
| 339 | - $limit = (int) $this->request->getParam('limit', 0); |
|
| 340 | - $shopId = (int) $this->request->getParam('shopId', 0); |
|
| 336 | + $localCategoryId = (int)$this->request->getParam('localCategoryId', 0); |
|
| 337 | + $localParentId = (int)$this->request->getParam('localParentId', 0); |
|
| 338 | + $offset = (int)$this->request->getParam('offset', 0); |
|
| 339 | + $limit = (int)$this->request->getParam('limit', 0); |
|
| 340 | + $shopId = (int)$this->request->getParam('shopId', 0); |
|
| 341 | 341 | |
| 342 | 342 | try { |
| 343 | 343 | $this->getImportService()->importRemoteCategoryAssignArticles($shopId, $remoteCategoryKey, $localCategoryId, $localParentId, $offset, $limit); |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | */ |
| 362 | 362 | public function unassignRemoteToLocalCategoryAction() |
| 363 | 363 | { |
| 364 | - $localCategoryId = (int) $this->request->getParam('localCategoryId', 0); |
|
| 364 | + $localCategoryId = (int)$this->request->getParam('localCategoryId', 0); |
|
| 365 | 365 | |
| 366 | 366 | if ($localCategoryId == 0) { |
| 367 | 367 | $this->View()->assign([ |