fileProcessor = $fileProcessor; parent::__construct( $context, $registry, $extensionFactory, $customAttributeFactory, $resource, $resourceCollection, $data ); } /** * @inheritDoc */ public function getOptionId() { return $this->getData(self::OPTION_ID); } /** * @inheritDoc */ public function setOptionId($value) { return $this->setData(self::OPTION_ID, $value); } /** * @inheritDoc */ public function getOptionValue() { $value = $this->getData(self::OPTION_VALUE); if ($value == 'file') { /** @var \Magento\Framework\Api\Data\ImageContentInterface $fileInfo */ $imageContent = $this->getExtensionAttributes() ? $this->getExtensionAttributes()->getFileInfo() : null; if ($imageContent) { $value = $this->fileProcessor->processFileContent($imageContent); } } return $value; } /** * @inheritDoc */ public function setOptionValue($value) { return $this->setData(self::OPTION_VALUE, $value); } /** * @inheritDoc */ public function getExtensionAttributes() { return $this->_getExtensionAttributes(); } /** * @inheritDoc */ public function setExtensionAttributes( \Magento\Catalog\Api\Data\CustomOptionExtensionInterface $extensionAttributes ) { return $this->_setExtensionAttributes($extensionAttributes); } }