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
ResourceModel
Stock
Status
StockStatusCriteriaMapper.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\CatalogInventory\Model\ResourceModel\Stock\Status
;
8
9
use
Magento\Framework\DB\GenericMapper
;
10
15
class
StockStatusCriteriaMapper
extends
GenericMapper
16
{
20
protected
function
init
()
21
{
22
$this->
initResource
(\
Magento
\CatalogInventory\Model\
ResourceModel
\
Stock
\Status::class);
23
}
24
30
public
function
mapInitialCondition
()
31
{
32
$this->
getSelect
()->join(
33
[
'cp_table'
=> $this->
getTable
(
'catalog_product_entity'
)],
34
'main_table.product_id = cp_table.entity_id'
,
35
[
'sku'
,
'type_id'
]
36
);
37
}
38
45
public
function
mapWebsiteFilter
(
$website
)
46
{
47
if
(
$website
instanceof \
Magento
\
Store
\Model\
Website
) {
48
$website
=
$website
->getId();
49
}
50
$this->
addFieldToFilter
(
'main_table.website_id'
,
$website
);
51
}
52
59
public
function
mapProductsFilter
(
$products
)
60
{
61
$productIds
= [];
62
if
(!is_array(
$products
)) {
63
$products
= [
$products
];
64
}
65
foreach
(
$products
as
$product
) {
66
if
(
$product
instanceof \
Magento
\Catalog\Model\
Product
) {
67
$productIds
[] =
$product
->getId();
68
}
else
{
69
$productIds
[] =
$product
;
70
}
71
}
72
if
(empty(
$productIds
)) {
73
$productIds
[] =
false
;
74
}
75
$this->
addFieldToFilter
(
'main_table.product_id'
, [
'in'
=>
$productIds
]);
76
}
77
84
public
function
mapQtyFilter
($qty)
85
{
86
$this->
addFieldToFilter
(
'main_table.qty'
, [
'lteq'
=> $qty]);
87
}
88
}
Magento\CatalogInventory\Model\ResourceModel\Stock\Status
Definition:
Collection.php:7
Magento\Catalog\Model\ResourceModel\Product
Definition:
CollectionTest.php:6
Magento\CatalogSearch\Model\Indexer\Fulltext\Store
Definition:
Store.php:17
Magento\CatalogInventory\Model\ResourceModel\Stock\Status\StockStatusCriteriaMapper\mapProductsFilter
mapProductsFilter($products)
Definition:
StockStatusCriteriaMapper.php:59
Magento\Framework\DB\AbstractMapper\addFieldToFilter
addFieldToFilter($field, $condition=null)
Definition:
AbstractMapper.php:161
$website
$website
Definition:
payment_configuration_rollback.php:38
$products
$products
Definition:
products_for_search.php:14
Magento\CatalogInventory\Model\ResourceModel\Stock\Status\StockStatusCriteriaMapper\mapWebsiteFilter
mapWebsiteFilter($website)
Definition:
StockStatusCriteriaMapper.php:45
Magento\Framework\DB\AbstractMapper\getSelect
getSelect()
Definition:
AbstractMapper.php:417
Magento\Framework\DB\GenericMapper
Definition:
GenericMapper.php:13
Magento\Catalog\Model\Product
Definition:
Product.php:42
Magento\Catalog\Model\Product\Website
Definition:
Website.php:17
Magento\Framework\DB\AbstractMapper\getTable
getTable($table)
Definition:
AbstractMapper.php:407
Magento\CatalogInventory\Model\ResourceModel\Stock\Status\StockStatusCriteriaMapper
Definition:
StockStatusCriteriaMapper.php:15
Magento
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22
Magento\Framework\DB\AbstractMapper\initResource
initResource($resourceInterface)
Definition:
AbstractMapper.php:226
Magento\CatalogInventory\Model\Stock
Definition:
Stock.php:15
Magento\CatalogInventory\Model\ResourceModel\Stock\Status\StockStatusCriteriaMapper\mapQtyFilter
mapQtyFilter($qty)
Definition:
StockStatusCriteriaMapper.php:84
Magento\CatalogInventory\Model\ResourceModel\Stock\Status\StockStatusCriteriaMapper\init
init()
Definition:
StockStatusCriteriaMapper.php:20
Magento\CatalogInventory\Model\ResourceModel\Stock\Status\StockStatusCriteriaMapper\mapInitialCondition
mapInitialCondition()
Definition:
StockStatusCriteriaMapper.php:30
$productIds
$productIds
Definition:
product_with_multiple_options.php:11