Returns the values of this enum as an array, suitable for insertion into
a {@link DropdownField}

@param boolean

@return array
3252
public function enumValues($hasEmpty = false)
    {
        return ($hasEmpty)
            ? array_merge(array('' => ''), ArrayLib::valuekey($this->getEnum()))
            : ArrayLib::valuekey($this->getEnum());
    }
1227366
public function toArray() {
		return array_filter(array(
			'name' => $this->getAttributeName(),
			'required' => $this->required,
			'type' => $this->type,
			'enum' => $this->getEnumOptions(),
			'default' => $this->default,
		));
	}
137782
public boolean[] getBooleanArray(final String key, final boolean[] def) {
		final boolean[] result = getBooleanArray(key);
		return result == null ? def : result;
	}
1237264
function() {
    var allOptions = this.dropdown.options;
    
    // Look for multiple selections
    if(this.multiple) {
        var values = [],
            i=0, j=allOptions.length;
        for(; i<j; i++) {
            if(allOptions[i].selected) {
                values.push(allOptions[i].value);
            }
        }
        return values;
    }
    // Only need to look for single selection
    else {
        return allOptions[allOptions.selectedIndex].value;
    }
}
378468
private FieldDoc[] fields(boolean filter, boolean enumConstants) {
        List<FieldDocImpl> fields = List.nil();
        for (Symbol sym : tsym.members().getSymbols(NON_RECURSIVE)) {
            if (sym != null && sym.kind == VAR) {
                VarSymbol s = (VarSymbol)sym;
                boolean isEnum = ((s.flags() & Flags.ENUM) != 0) &&
                                 !env.legacyDoclet;
                if (isEnum == enumConstants &&
                        (!filter || env.shouldDocument(s))) {
                    fields = fields.prepend(env.getFieldDoc(s));
                }
            }
        }
        return fields.toArray(new FieldDocImpl[fields.length()]);
    }
888761
public static boolean getBoolean(JSONValue value) {
        if (value == null)
            return false;
        if (!(value instanceof JSONBoolean))
            throw new JSONException(NOT_A_BOOLEAN);
        return ((JSONBoolean)value).booleanValue();
    }
474396
protected function getEnumValuesFromType($type)
    {
        if ( ! preg_match('#^enum\((?<values>.*)\)$#i', $type, $matches)) {
            return false;
        }

        $enum = [];

        foreach (explode(',', $matches['values']) as $value) {
            $v      = trim( $value, "'" );
            $enum[] = $v;
        }

        return $enum;
    }
970089
static function createBooleanElement( $boolean, $variablePlacement = false )
    {
        if ( !is_bool( $boolean ) )
            $boolean = (bool)$boolean;
        return array( eZTemplate::TYPE_BOOLEAN,
                      $boolean, $variablePlacement );
    }
1114862
public function toOptionArray()
    {
        $fields = [];
        //default data option
        $fields[] = ['value' => '0', 'label' => '-- Please Select --'];
        $websiteId = $this->helper->getWebsiteForSelectedScopeInAdmin()->getId();
        $apiEnabled = $this->helper->isEnabled($websiteId);
        if ($apiEnabled) {
            $savedDatafields = $this->registry->registry('datafields');

            //get saved datafileds from registry
            if ($savedDatafields) {
                $datafields = $savedDatafields;
            } else {
                //grab the datafields request and save to register
                $client = $this->helper->getWebsiteApiClient($websiteId);
                $datafields = $client->getDatafields();
                $this->registry->unregister('datafields'); // additional measure
                $this->registry->register('datafields', $datafields);
            }

            //set the api error message for the first option
            if (isset($datafields->message)) {
                //message
                $fields[] = [
                    'value' => 0,
                    'label' => $datafields->message,
                ];
            } else {
                //loop for all datafields option
                foreach ($datafields as $datafield) {
                    if (isset($datafield->name)) {
                        $fields[] = [
                            'value' => $datafield->name,
                            'label' => $datafield->name,
                        ];
                    }
                }
            }
        }

        return $fields;
    }
1272687
protected static function parseBooleanType(&$data, &$result)
    {
        // Boolean type
        $booleanValue = (bool) (ord($data[2]) == 0xff);
        $dataI = substr($data, 3);
        $result[] = [
            'boolean (1)',
            $booleanValue, ];
        $data = $dataI;
    }
680236
public function __values(bool $to_array = null):array{
		return array_values($to_array === true ? $this->__toArray() : $this->array);
	}
427192
public static boolean getBoolean(JsonObject object, String field, boolean defaultValue) {
        final JsonValue value = object.get(field);
        if (value == null || value.isNull()) {
            return defaultValue;
        } else {
            return value.asBoolean();
        }
    }
565694
@PublicEvolving
	public boolean getBoolean(ConfigOption<Boolean> configOption) {
		Object o = getValueOrDefaultFromOption(configOption);
		return convertToBoolean(o);
	}
1266029
public boolean[] toBooleanArray() {
        boolean[] bits = new boolean[length];

        for (int i=0; i < length; i++) {
            bits[i] = get(i);
        }
        return bits;
    }
1076648
public Boolean getBoolean(int index) {
        Object bool = list.get(index);
        if (bool == null) return null;
        if (bool instanceof Boolean) return (Boolean) bool;
        throw new JsonException("not a boolean");
    }
140805
public String[] getOptionValues(String opt)
    {
        List<String> values = new ArrayList<String>();

        for (Option option : options)
        {
            if (opt.equals(option.getOpt()) || opt.equals(option.getLongOpt()))
            {
                values.addAll(option.getValuesList());
            }
        }

        return values.isEmpty() ? null : values.toArray(new String[values.size()]);
    }
561393
public function application(bool $null = true) : array
    {
        $config = $this->appConfig;
        if ($null) {
            $this->appConfig = [];
        }
        return $config;
    }