abstract class AbstractEnum implements EnumInterface (View source)

The base enum class that all other enum classes extend from. It does the heavy lifting of implementing EnumInterface so that extending enum classes can focus on defining enums.

Methods

static array
introspect()

Introspects the Enum for its values.

static array
introspectKeys()

Introspects the Enum for its keys.

static bool
hasValue(string $value)

Determines if the value is one of the Enum values of this type.

Details

static array introspect()

Introspects the Enum for its values.

Return Value

array An associative array where the constant name is the key and the constant value is the value.

static array introspectKeys()

Introspects the Enum for its keys.

Return Value

array An indexed array of constant names.

static bool hasValue(string $value)

Determines if the value is one of the Enum values of this type.

Parameters

string $value The value to compare.

Return Value

bool Whether or not the value is one of the Enum values of this type. A value of true means that the value is one of the Enum values. A value of false means that the value is NOT one of the Enum values.