Skip to content

Commit 219ad3f

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-86273' into 2.2-develop-pr56
2 parents bd7f760 + df8ea96 commit 219ad3f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

app/code/Magento/Reports/Model/ResourceModel/Quote/Collection.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
*/
66
namespace Magento\Reports\Model\ResourceModel\Quote;
77

8+
use Magento\Store\Model\Store;
9+
810
/**
11+
* Collection of abandoned quotes with reports join.
12+
*
913
* @api
1014
* @since 100.0.2
1115
*/
@@ -48,6 +52,24 @@ public function __construct(
4852
$this->customerResource = $customerResource;
4953
}
5054

55+
/**
56+
* Filter collections by stores.
57+
*
58+
* @param array $storeIds
59+
* @param bool $withAdmin
60+
* @return $this
61+
*/
62+
public function addStoreFilter(array $storeIds, bool $withAdmin = true)
63+
{
64+
if ($withAdmin) {
65+
$storeIds[] = Store::DEFAULT_STORE_ID;
66+
}
67+
68+
$this->addFieldToFilter('store_id', ['in' => $storeIds]);
69+
70+
return $this;
71+
}
72+
5173
/**
5274
* Prepare for abandoned report
5375
*

0 commit comments

Comments
 (0)