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-bundle-graph-ql
Model
Resolver
BundleItemLinks.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\BundleGraphQl\Model\Resolver
;
9
10
use
Magento\Framework\GraphQl\Exception\GraphQlInputException
;
11
use
Magento\Framework\GraphQl\Schema\Type\ResolveInfo
;
12
use
Magento\BundleGraphQl\Model\Resolver\Links\Collection
;
13
use
Magento\Framework\GraphQl\Config\Element\Field
;
14
use
Magento\Framework\GraphQl\Query\Resolver\ValueFactory
;
15
use
Magento\Framework\GraphQl\Query\ResolverInterface
;
16
20
class
BundleItemLinks
implements
ResolverInterface
21
{
25
private
$linkCollection;
26
30
private
$valueFactory;
31
36
public
function
__construct
(
37
Collection
$linkCollection,
38
ValueFactory
$valueFactory
39
) {
40
$this->linkCollection =
$linkCollection
;
41
$this->valueFactory = $valueFactory;
42
}
43
47
public
function
resolve
(
Field
$field, $context,
ResolveInfo
$info
, array
$value
=
null
, array $args =
null
)
48
{
49
if
(!isset(
$value
[
'option_id'
]) || !isset(
$value
[
'parent_id'
])) {
50
throw
new
GraphQlInputException
(
__
(
'"option_id" and "parent_id" values should be specified'
));
51
}
52
53
$this->linkCollection->addIdFilters((
int
)
$value
[
'option_id'
], (
int
)
$value
[
'parent_id'
]);
54
$result
=
function
() use (
$value
) {
55
return
$this->linkCollection->getLinksForOptionId((
int
)
$value
[
'option_id'
]);
56
};
57
58
return
$this->valueFactory->create(
$result
);
59
}
60
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\BundleGraphQl\Model\Resolver\BundleItemLinks
Definition:
BundleItemLinks.php:20
Magento\BundleGraphQl\Model\Resolver
Definition:
BundleItemLinks.php:8
Magento\Framework\GraphQl\Query\ResolverInterface
Definition:
ResolverInterface.php:18
Magento\BundleGraphQl\Model\Resolver\Links\Collection
Definition:
Collection.php:18
$linkCollection
$linkCollection
Definition:
quote_with_downloadable_product.php:16
Magento\Framework\GraphQl\Schema\Type\ResolveInfo
Definition:
ResolveInfo.php:13
__
__()
Definition:
__.php:13
Magento\BundleGraphQl\Model\Resolver\BundleItemLinks\__construct
__construct(Collection $linkCollection, ValueFactory $valueFactory)
Definition:
BundleItemLinks.php:36
Magento\BundleGraphQl\Model\Resolver\BundleItemLinks\resolve
resolve(Field $field, $context, ResolveInfo $info, array $value=null, array $args=null)
Definition:
BundleItemLinks.php:47
Magento\Framework\GraphQl\Config\Element\Field
Definition:
Field.php:15
$value
$value
Definition:
gender.phtml:16
Magento\Framework\GraphQl\Query\Resolver\ValueFactory
Definition:
ValueFactory.php:15
$info
foreach( $_productCollection as $_product)() ?>" class $info
Definition:
listing.phtml:52
Magento\Framework\GraphQl\Exception\GraphQlInputException
Definition:
GraphQlInputException.php:16