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-graph-ql
Model
Resolver
Product
TierPrices.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\CatalogGraphQl\Model\Resolver\Product
;
9
10
use
Magento\Framework\GraphQl\Exception\GraphQlInputException
;
11
use
Magento\Framework\GraphQl\Schema\Type\ResolveInfo
;
12
use
Magento\Catalog\Model\Product
;
13
use
Magento\Catalog\Model\Product\TierPrice
;
14
use
Magento\Framework\GraphQl\Config\Element\Field
;
15
use
Magento\Framework\GraphQl\Query\ResolverInterface
;
16
22
class
TierPrices
implements
ResolverInterface
23
{
29
public
function
resolve
(
30
Field
$field,
31
$context,
32
ResolveInfo
$info
,
33
array
$value
=
null
,
34
array $args =
null
35
) {
36
if
(!isset(
$value
[
'model'
])) {
37
throw
new
GraphQlInputException
(
__
(
'"model" value should be specified'
));
38
}
39
41
$product
=
$value
[
'model'
];
42
43
$tierPrices
=
null
;
44
if
(
$product
->getTierPrices()) {
45
$tierPrices
= [];
47
foreach
(
$product
->getTierPrices() as $tierPrice) {
48
$tierPrices
[] = $tierPrice->getData();
49
}
50
}
51
52
return
$tierPrices
;
53
}
54
}
Magento\Framework\GraphQl\Query\ResolverInterface
Definition:
ResolverInterface.php:18
Magento\Catalog\Model\Product\TierPrice
Definition:
TierPrice.php:12
Magento\Framework\GraphQl\Schema\Type\ResolveInfo
Definition:
ResolveInfo.php:13
__
__()
Definition:
__.php:13
Magento\CatalogGraphQl\Model\Resolver\Product\TierPrices
Definition:
TierPrices.php:22
Magento\Framework\GraphQl\Config\Element\Field
Definition:
Field.php:15
$value
$value
Definition:
gender.phtml:16
Magento\CatalogGraphQl\Model\Resolver\Product
Definition:
CanonicalUrl.php:8
Magento\Catalog\Model\Product
Definition:
ActionTest.php:6
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22
$info
foreach( $_productCollection as $_product)() ?>" class $info
Definition:
listing.phtml:52
Magento\Framework\GraphQl\Query\ResolverInterface\resolve
resolve(Field $field, $context, ResolveInfo $info, array $value=null, array $args=null)
$tierPrices
$tierPrices
Definition:
product_has_tier_price_show_as_low_as.php:14
Magento\Framework\GraphQl\Exception\GraphQlInputException
Definition:
GraphQlInputException.php:16