Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-catalog
Ui
DataProvider
Product
AddStoreFieldToCollection.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Catalog\Ui\DataProvider\Product
;
7
8
use
Magento\Framework\Data\Collection
;
9
use
Magento\Store\Model\StoreManagerInterface
;
10
use
Magento\Ui\DataProvider\AddFilterToCollectionInterface
;
11
16
class
AddStoreFieldToCollection
implements
AddFilterToCollectionInterface
17
{
23
protected
$storeManager
;
24
30
public
function
__construct
(
StoreManagerInterface
$storeManager
)
31
{
32
$this->storeManager =
$storeManager
;
33
}
34
38
public
function
addFilter
(
Collection
$collection
, $field, $condition =
null
)
39
{
40
if
(isset($condition[
'eq'
]) && $condition[
'eq'
]) {
42
$collection
->addStoreFilter($this->storeManager->getStore($condition[
'eq'
]));
43
}
44
}
45
}
Magento\Ui\DataProvider\AddFilterToCollectionInterface
Definition:
AddFilterToCollectionInterface.php:13
Magento\Framework\Data\Collection
Definition:
AbstractDb.php:6
Magento\Store\Model\StoreManagerInterface
Definition:
StoreManagerInterface.php:17
Magento\Catalog\Ui\DataProvider\Product\AddStoreFieldToCollection
Definition:
AddStoreFieldToCollection.php:16
Magento\Catalog\Ui\DataProvider\Product\AddStoreFieldToCollection\$storeManager
$storeManager
Definition:
AddStoreFieldToCollection.php:23
Magento\Framework\Data\Collection
Definition:
Collection.php:19
Magento\Catalog\Ui\DataProvider\Product\AddStoreFieldToCollection\__construct
__construct(StoreManagerInterface $storeManager)
Definition:
AddStoreFieldToCollection.php:30
Magento\Ui\DataProvider\AddFilterToCollectionInterface\addFilter
addFilter(Collection $collection, $field, $condition=null)
Magento\Catalog\Ui\DataProvider\Product
$collection
$collection
Definition:
catalog_category_with_apostrophe_rollback.php:17