6 declare(strict_types=1);
27 private $optionCollection;
32 private $valueFactory;
37 private $metadataPool;
45 OptionCollection $optionCollection,
50 $this->valueFactory = $valueFactory;
51 $this->metadataPool = $metadataPool;
61 $linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();
62 if (
$value[
'type_id'] !== Type::TYPE_CODE || !isset(
$value[$linkField])) {
66 return $this->valueFactory->create(
$result);
69 $this->optionCollection->addProductId((
int)
$value[$linkField]);
72 return $this->optionCollection->getAttributesByProductId((
int)
$value[$linkField]);
75 return $this->valueFactory->create(
$result);
resolve(Field $field, $context, ResolveInfo $info, array $value=null, array $args=null)
__construct(OptionCollection $optionCollection, ValueFactory $valueFactory, MetadataPool $metadataPool)
foreach( $_productCollection as $_product)() ?>" class $info