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
NewFromTo.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\Framework\GraphQl\Config\Element\Field
;
14
use
Magento\Framework\GraphQl\Query\ResolverInterface
;
15
19
class
NewFromTo
implements
ResolverInterface
20
{
26
public
function
resolve
(
27
Field
$field,
28
$context,
29
ResolveInfo
$info
,
30
array
$value
=
null
,
31
array $args =
null
32
) {
33
if
(!isset(
$value
[
'model'
])) {
34
throw
new
GraphQlInputException
(
__
(
'"model" value should be specified'
));
35
}
36
38
$product
=
$value
[
'model'
];
39
$attributeName = substr_replace($field->
getName
(),
's'
, 3, 0);
40
41
$data
=
null
;
42
if
(
$product
->getData($attributeName)) {
43
$data
=
$product
->getData($attributeName);
44
}
45
46
return
$data
;
47
}
48
}
Magento\Framework\GraphQl\Query\ResolverInterface
Definition:
ResolverInterface.php:18
Magento\Framework\GraphQl\Schema\Type\ResolveInfo
Definition:
ResolveInfo.php:13
Magento\CatalogGraphQl\Model\Resolver\Product\NewFromTo
Definition:
NewFromTo.php:19
Magento\Framework\GraphQl\Config\Element\Field\getName
getName()
Definition:
Field.php:85
__
__()
Definition:
__.php:13
Magento\Framework\GraphQl\Config\Element\Field
Definition:
Field.php:15
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
$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)
Magento\Framework\GraphQl\Exception\GraphQlInputException
Definition:
GraphQlInputException.php:16