Class Enum
Based on SplEnum, this class allows enumerated types to be created.
Extend this class to create your enums in the following way
class Fruit extends Enum { const APPLE = 1; const ORANGE = 2; const _DEFAULT = 1; }
_DEFAULT is optional and will be used if no paramater is passed to the constructor
echo new Fruit(); echo new Fruit(Fruit::ORANGE); echo Fruit::valueOf("orange");
Will output: 1 2 2
- picon\Enum implements picon\Identifiable, picon\Equalable
public
|
|
public static
The
|
|
public static
Array
|
|
public
A
|
|
public
Boolean
|
|
public static
|
string
|
DEFAULT_NAME
|
"_DEFAULT" |