44 throw new InputException(
__(
'The attribute code is empty. Enter the code and try again.'));
52 $optionLabel =
$option->getLabel();
58 if (is_array(
$option->getStoreLabels())) {
71 if ($optionLabel &&
$attribute->getAttributeCode()) {
78 return $this->getOptionId(
$option);
87 throw new InputException(
__(
'The attribute code is empty. Enter the code and try again.'));
118 throw new InputException(
__(
'The attribute code is empty. Enter the code and try again.'));
142 'The "%1" attribute doesn\'t include an option with "%2" ID.',
156 return $option->getValue() ?:
'new_option';
165 private function setOptionValue(
validateOption($attribute, $optionId)
elseif(isset( $params[ 'redirect_parent']))
add($entityType, $attributeCode, $option)
__construct(\Magento\Eav\Model\AttributeRepository $attributeRepository, \Magento\Eav\Model\ResourceModel\Entity\Attribute $resourceModel)
getItems($entityType, $attributeCode)