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-inventory
Model
AddStockStatusToCollection.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\CatalogInventory\Model
;
8
9
use
Magento\Catalog\Model\ResourceModel\Product\Collection
;
10
14
class
AddStockStatusToCollection
15
{
19
protected
$stockHelper
;
20
25
public
function
__construct
(
26
\
Magento
\CatalogInventory\Helper\
Stock
$stockHelper
27
) {
28
$this->stockHelper =
$stockHelper
;
29
}
30
37
public
function
beforeLoad
(
Collection
$productCollection
, $printQuery =
false
, $logQuery =
false
)
38
{
39
$this->stockHelper->addIsInStockFilterToCollection(
$productCollection
);
40
return
[$printQuery, $logQuery];
41
}
42
}
Magento\Catalog\Model\ResourceModel\Product\Collection
Definition:
ProductLimitation.php:6
Magento\CatalogInventory\Model\AddStockStatusToCollection\beforeLoad
beforeLoad(Collection $productCollection, $printQuery=false, $logQuery=false)
Definition:
AddStockStatusToCollection.php:37
Magento\CatalogInventory\Model\AddStockStatusToCollection\__construct
__construct(\Magento\CatalogInventory\Helper\Stock $stockHelper)
Definition:
AddStockStatusToCollection.php:25
Magento\CatalogInventory\Model\AddStockStatusToCollection
Definition:
AddStockStatusToCollection.php:14
$productCollection
$productCollection
Definition:
configurable_attribute_rollback.php:12
Magento
Magento\CatalogInventory\Model
Magento\Catalog\Model\ResourceModel\Product\Collection
Definition:
Collection.php:36
Magento\CatalogInventory\Model\Stock
Definition:
Stock.php:15
Magento\CatalogInventory\Model\AddStockStatusToCollection\$stockHelper
$stockHelper
Definition:
AddStockStatusToCollection.php:19