N98\Magento\Command\Eav\Attribute\Create\DummyCommand::attributeValueExists PHP Method

attributeValueExists() private method

Check if an option exist
private attributeValueExists ( Mage_Eav_Model_Entity_Attribute $attribute, string $arg_value ) : boolean
$attribute Mage_Eav_Model_Entity_Attribute
$arg_value string
return boolean
    private function attributeValueExists(Mage_Eav_Model_Entity_Attribute $attribute, $arg_value)
    {
        $options = Mage::getModel('eav/entity_attribute_source_table');
        $options->setAttribute($attribute);
        $options = $options->getAllOptions(false);
        foreach ($options as $option) {
            if ($option['label'] === $arg_value) {
                return true;
            }
        }
        return false;
    }