Get options array.

@param string $attribute
@param bool $isEmpty

@return array
166292
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;
    }
1216182
public function get($attribute, $default = null)
    {
        list($relationArray, $column, $jsonArray) = FieldNameSlicer::split($attribute);
        $key = join('.', array_merge($relationArray, [$column]));
        $value = data_get($this->data, $key);

        if ($jsonArray) {
            $value = is_string($value) ? json_decode($value) : $value;

            return data_get($value, join('.', $jsonArray), $default);
        }

        return is_null($value) ? $default : $value;
    }
281101
public function getSingleAdderCodeDocumentationParameterLines(PHPAttribute $attribute)
    {
        $lines = [];

        $lines[] = '@param ' . $attribute->getPhpSingleTypeBase() . ' $' . $attribute->getSingleName();
        $lines[] = '@param bool $_allowRepeatedValues';

        return $lines;
    }
1337446
public static function values($withEmpty = false) {
        static $list = [];

        $className = static::class;
        if (!isset($list[$className])) {
            $list[$className] = [];
            foreach (static::constants() as $value => $code) {
                $value = Inflector::humanize(strtolower($value), true);
                $list[$className][$code] = static::t($value);
            }
        }

        return ($withEmpty ? ['' => static::emptyValue()] : [])
            + $list[$className];
    }
562013
protected function _getOptions(array $options, array $selected = array(), $isMultiple = false)
    {
        $output = array();

        list($options, $_selected) = $this->_checkNoSelected($options, $selected, $isMultiple);

        foreach ($options as $key => $data) {
            $label = $data;
            $value = $key;

            $classes = implode(' ', array(
                $this->_jbSrt('option'),
                $this->_jbSrt('option-' . Str::slug($value, true)),
            ));

            $isSelected = $this->_isSelected($value, $_selected);

            if (is_array($data)) {
                $output[] = $this->_createGroup($key, $data, $_selected, $options);
            } else {
                $output[] = $this->_option($value, $isSelected, $classes, $label);
            }
        }

        return implode(PHP_EOL, $output);
    }
611038
public function getOptionIds(Attribute $attribute, $labels)
    {
        $optionIds = [];

        if (!is_array($labels)) {
            $labels = [$labels];
        }

        $options = $attribute->getSource()->getAllOptions();

        foreach ($labels as $label) {
            foreach ($options as $option) {
                if ($option['label'] == $label) {
                    $optionIds[] = (int) $option['value'];
                }
            }
        }

        return $optionIds;
    }
713036
public function getConverterOptions($converter, $attribute)
    {
        $lcAttr = strtolower($attribute);

        $options = [];
        if (isset($this->converterOptions[$converter]) && isset($this->converterOptions[$converter][$lcAttr])) {
            $options = $this->converterOptions[$converter][$lcAttr];
        }

        return $options;
    }
64631
public function getGetterCodeLines(CPPAttribute $attribute)
    {
        $lines = [];

        $base = $this->getEntity()->getProject()->getAutocodeProperty('base');

        if ('object' === $attribute->getType()) {
            $lines[] = $attribute->getStatic()
                ? $attribute->getEntitySubtype()->getName() . ' ' . ($base ? $this->getEntity()->getNameBase() : $this->getEntity()->getName()) . '::' . $attribute->getGetterName() . '()'
                : $attribute->getEntitySubtype()->getName() . ' ' . ($base ? $this->getEntity()->getNameBase() : $this->getEntity()->getName()) . '::' . $attribute->getGetterName() . '()';
        } else {
            $lines[] = $attribute->getStatic()
                ? $attribute->getType() . ' ' . ($base ? $this->getEntity()->getNameBase() : $this->getEntity()->getName()) . '::' . $attribute->getGetterName() . '()'
                : $attribute->getType() . ' ' . ($base ? $this->getEntity()->getNameBase() : $this->getEntity()->getName()) . '::' . $attribute->getGetterName() . '()';
        }

        $lines[] = '{';
        $lines[] =     'return ' . $attribute->getName() . ';';
        $lines[] = '};';

        return $lines;
    }
381913
public function getRelationData($attribute)
    {
        return isset($this->relationalData[$attribute]) ? $this->relationalData[$attribute]['data'] : null;
    }
1287819
public function getGetterDeclarationLines(CPPAttribute $attribute)
    {
        $lines = [];

        if ('object' === $attribute->getType()) {
            $lines[] = $attribute->getStatic()
                ? $attribute->getEntitySubtype()->getName() . ' ' . $attribute->getGetterName() . '();'
                : $attribute->getEntitySubtype()->getName() . ' ' . $attribute->getGetterName() . '();';
        } else {
            $lines[] = $attribute->getStatic()
                ? $attribute->getType() . ' ' . $attribute->getGetterName() . '();'
                : $attribute->getType() . ' ' . $attribute->getGetterName() . '();';
        }

        return $lines;
    }
1186298
public function getSetterCodeDocumentationParameterLines(JavaAttribute $attribute)
    {
        $lines = [];

        $lines[] = '@param ' . $attribute->getType() . ' ' . $attribute->getLowerFullName();

        return $lines;
    }
774198
public function validateEmptyWith($attribute, $value, $parameters)
    {
        $values = [];

        foreach ($parameters as $parameter) {
            $values[] = $this->getValue($parameter);
        }

        return Validator::isEmptyWith($value, $values);
    }
1071697
public function fetchValues($tag, $attribute)
    {
        $values = array();

        // loop through each tag in the dom and add it to the array
        foreach ($this->getElementsByTagName($tag) as $element) {
            /* @var $element \DOMElement */
            $values[] = $element->getAttribute($attribute);
        }

        return $values;
    }
108539
def GetValuesByAttrib(self, attribute):
    """"""

    if attribute not in self._options_cls.ValidOptions():
      raise ValueError("'%s': Not a valid attribute." % attribute)

    result = []
    for value in self.values:
      if attribute in value.OptionNames():
        result.append(value.name)

    return result
818898
public static function optionsRestrictions($include_empty): array
    {
        $options = [
            'none'         => I18N::translate('Show to visitors'),
            'privacy'      => I18N::translate('Show to members'),
            'confidential' => I18N::translate('Show to managers'),
            'locked'       => I18N::translate('Only managers can edit'),
        ];

        if ($include_empty) {
            $options = ['' => ''] + $options;
        }

        return $options;
    }
248301
public function getAttributeToLdap($attribute)
    {
        return $this->hasAttribute($attribute) ? $this->lcAttributeNameMap[strtolower($attribute)] : $attribute;
    }
49373
protected function getValue($attribute)
    {
        if (!is_null($value = array_get($this->data, $attribute))) {
            return $value;
        } elseif (!is_null($value = array_get($this->files, $attribute))) {
            return $value;
        }
    }