Skip to content

Commit c0ece64

Browse files
committed
ACP2E-894: add new argument to filter customer orders based on scope level
1 parent ace41d1 commit c0ece64

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/code/Magento/SalesGraphQl/Model/Resolver/CustomerOrders.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
/**
2626
* Orders data resolver
27+
*
28+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2729
*/
2830
class CustomerOrders implements ResolverInterface
2931
{
@@ -64,13 +66,13 @@ public function __construct(
6466
SearchCriteriaBuilder $searchCriteriaBuilder,
6567
OrderFilter $orderFilter,
6668
OrderFormatter $orderFormatter,
67-
StoreManagerInterface $storeManager = null
69+
?StoreManagerInterface $storeManager = null
6870
) {
6971
$this->orderRepository = $orderRepository;
7072
$this->searchCriteriaBuilder = $searchCriteriaBuilder;
7173
$this->orderFilter = $orderFilter;
7274
$this->orderFormatter = $orderFormatter;
73-
$this->storeManager = ObjectManager::getInstance()->get(StoreManagerInterface::class) ?? null;
75+
$this->storeManager = $storeManager ?? ObjectManager::getInstance()->get(StoreManagerInterface::class);
7476
}
7577

7678
/**
@@ -146,6 +148,8 @@ private function getSearchResult(array $args, int $userId, int $storeId, array $
146148
}
147149

148150
/**
151+
* Get eligible store to filter by based on scope
152+
*
149153
* @param string $scope
150154
* @param StoreInterface $store
151155
* @return array
@@ -172,6 +176,8 @@ private function getStoresByScope(string $scope, StoreInterface $store): array
172176
}
173177

174178
/**
179+
* Filter store ids based on selected scope
180+
*
175181
* @param int|null $websiteId
176182
* @param int|null $storeGroupId
177183
* @return array

0 commit comments

Comments
 (0)