optionManager = $optionManager; } /** * @param int $entityType * @param string $attributeCode * @return array */ public function getData(int $entityType, string $attributeCode): array { $options = $this->optionManager->getItems($entityType, $attributeCode); $optionsData = []; foreach ($options as $option) { // without empty option @see \Magento\Eav\Model\Entity\Attribute\Source\Table::getAllOptions if ($option->getValue() === '') { continue; } $optionsData[] = [ 'label' => $option->getLabel(), 'value' => $option->getValue() ]; } return $optionsData; } }