/** * {@inheritdoc} */ public function getTypes() { $optionList = $this->type->toOptionArray(); /** @var Type[] $typeDtoList */ $typeDtoList = []; foreach ($optionList as $option) { $typeDtoList[] = $this->typeConverter->createDataFromModel($option); } return $typeDtoList; }
/** * @return mixed */ public function getTypeSelectHtml() { $select = $this->getLayout()->createBlock('Magento\\Framework\\View\\Element\\Html\\Select')->setData(array('id' => $this->getFieldId() . '_{{index}}_type', 'class' => 'select select-product-option-type required-option-select', 'extra_params' => 'onchange="bOption.changeType(event)"'))->setName($this->getFieldName() . '[{{index}}][type]')->setOptions($this->_optionTypes->toOptionArray()); return $select->getHtml(); }