File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed
DownloadableGraphQl/Model
GroupedProductGraphQl/Model Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 88namespace Magento \BundleGraphQl \Model ;
99
1010use Magento \Framework \GraphQl \Query \Resolver \TypeResolverInterface ;
11+ use Magento \Bundle \Model \Product \Type as Type ;
1112
1213/**
1314 * {@inheritdoc}
1415 */
1516class BundleProductTypeResolver implements TypeResolverInterface
1617{
18+ const BUNDLE_PRODUCT = 'BundleProduct ' ;
19+
1720 /**
1821 * {@inheritdoc}
1922 */
2023 public function resolveType (array $ data ) : string
2124 {
22- if (isset ($ data ['type_id ' ]) && $ data ['type_id ' ] == ' bundle ' ) {
23- return ' BundleProduct ' ;
25+ if (isset ($ data ['type_id ' ]) && $ data ['type_id ' ] == Type:: TYPE_CODE ) {
26+ return self :: BUNDLE_PRODUCT ;
2427 }
2528 return '' ;
2629 }
Original file line number Diff line number Diff line change 88namespace Magento \DownloadableGraphQl \Model ;
99
1010use Magento \Framework \GraphQl \Query \Resolver \TypeResolverInterface ;
11+ use Magento \Downloadable \Model \Product \Type as Type ;
1112
1213/**
1314 * {@inheritdoc}
1415 */
1516class DownloadableProductTypeResolver implements TypeResolverInterface
1617{
18+ const DOWNLOADABLE_PRODUCT = 'DownloadableProduct ' ;
1719 /**
1820 * {@inheritdoc}
1921 */
2022 public function resolveType (array $ data ) : string
2123 {
22- if (isset ($ data ['type_id ' ]) && $ data ['type_id ' ] == ' downloadable ' ) {
23- return ' DownloadableProduct ' ;
24+ if (isset ($ data ['type_id ' ]) && $ data ['type_id ' ] == Type:: TYPE_DOWNLOADABLE ) {
25+ return self :: DOWNLOADABLE_PRODUCT ;
2426 }
2527 return '' ;
2628 }
Original file line number Diff line number Diff line change 88namespace Magento \GroupedProductGraphQl \Model ;
99
1010use Magento \Framework \GraphQl \Query \Resolver \TypeResolverInterface ;
11-
11+ use Magento \ GroupedProduct \ Model \ Product \ Type \ Grouped as Type ;
1212/**
1313 * {@inheritdoc}
1414 */
1515class GroupedProductTypeResolver implements TypeResolverInterface
1616{
17+ const GROUPED_PRODUCT = 'GroupedProduct ' ;
1718 /**
1819 * {@inheritdoc}
1920 */
2021 public function resolveType (array $ data ) : string
2122 {
22- if (isset ($ data ['type_id ' ]) && $ data ['type_id ' ] == ' grouped ' ) {
23- return ' GroupedProduct ' ;
23+ if (isset ($ data ['type_id ' ]) && $ data ['type_id ' ] == Type:: TYPE_CODE ) {
24+ return self :: GROUPED_PRODUCT ;
2425 }
2526 return '' ;
2627 }
You can’t perform that action at this time.
0 commit comments