Model/Adminhtml/Source/Rules/Value.php
public function getValueSelectOptions($attribute, $isEmpty = false)
    {
        $options = [];
        if ($isEmpty) {
            $options
                = $this->yesno->toOptionArray();

            return $options;
        }

        switch ($attribute) {
            case 'country_id':
                $options = $this->country->toOptionArray();
                break;

            case 'region_id':
                $options = $this->allregion->toOptionArray();
                break;

            case 'shipping_method':
                $options = $this->allShippingMethods->toOptionArray();
                break;

            case 'method':
                $options = $this->allPaymentMethods->toOptionArray();
                break;

            case 'customer_group_id':
                $options = $this->sourceGroup->toOptionArray();
                break;

            default:
                $attribute
                    = $this->configFactory->getAttribute(
                        'catalog_product',
                        $attribute
                    );
                if ($attribute->usesSource()) {
                    $options = $attribute->getSource()->getAllOptions();
                }
        }

        return $options;
    }
public function getValueSelectOptions($attribute, $isEmpty = false)
    {
        $options = [];
        if ($isEmpty) {
            $options
                = $this->yesno->toOptionArray();

            return $options;
        }

        switch ($attribute) {
            case 'country_id':
                $options = $this->country->toOptionArray();
                break;

            case 'region_id':
                $options = $this->allregion->toOptionArray();
                break;

            case 'shipping_method':
                $options = $this->allShippingMethods->toOptionArray();
                break;

            case 'method':
                $options = $this->allPaymentMethods->toOptionArray();
                break;

            case 'customer_group_id':
                $options = $this->sourceGroup->toOptionArray();
                break;

            default:
                $attribute
                    = $this->configFactory->getAttribute(
                        'catalog_product',
                        $attribute
                    );
                if ($attribute->usesSource()) {
                    $options = $attribute->getSource()->getAllOptions();
                }
        }

        return $options;
    }
public function getValueSelectOptions ( $ attribute , $ isEmpty = false ) { $ options = [ ] ; if ( $ isEmpty ) { $ options = $ this -> yesno -> toOptionArray ( ) ; return $ options ; } switch ( $ attribute ) { case 'country_id' : $ options = $ this -> country -> toOptionArray ( ) ; break ; case 'region_id' : $ options = $ this -> allregion -> toOptionArray ( ) ; break ; case 'shipping_method' : $ options = $ this -> allShippingMethods -> toOptionArray ( ) ; break ; case 'method' : $ options = $ this -> allPaymentMethods -> toOptionArray ( ) ; break ; case 'customer_group_id' : $ options = $ this -> sourceGroup -> toOptionArray ( ) ; break ; default : $ attribute = $ this -> configFactory -> getAttribute ( 'catalog_product' , $ attribute ) ; if ( $ attribute -> usesSource ( ) ) { $ options = $ attribute -> getSource ( ) -> getAllOptions ( ) ; } } return $ options ; }
Get options array.

@param string $attribute
@param bool $isEmpty

@return array
Get options array .