BaseEnum
Table of Contents
Methods
- all() : array<string|int, mixed>
- Get enums.
- equals() : bool
- Test if 2 enum are equals.
- jsonSerialize() : mixed
- Serialize to json.
- label() : string
- Get enum label.
- make() : BaseEnum|null
- Fetch enum using value.
- name() : string
- Get enum name.
- toArray() : array<string|int, mixed>
- Get enums.
- toLabels() : array<string|int, string>
- Get enum labels.
- toValues() : array<string|int, int|string>
- Get enum values.
- value() : string|int
- Get enum value.
- getCache() : array<string|int, mixed>
- Get cache array.
- getCustomDefinitions() : array<string|int, mixed>
- Get custom constants.
- getLabelsConstant() : array<string|int, mixed>|null
- Fetch the LABELS constant if exists.
- initCache() : void
- Init cache if needed.
- setCache() : void
- Set cache array.
Methods
all()
Get enums.
public
static all() : array<string|int, mixed>
Return values
array<string|int, mixed>equals()
Test if 2 enum are equals.
public
equals(object ...$others) : bool
Parameters
- $others : object
Tags
Return values
booljsonSerialize()
Serialize to json.
public
jsonSerialize() : mixed
label()
Get enum label.
public
label() : string
Return values
stringmake()
Fetch enum using value.
public
static make(BaseEnum|int|string $value[, string $field = 'value' ]) : BaseEnum|null
Parameters
- $value : BaseEnum|int|string
- $field : string = 'value'
Return values
BaseEnum|nullname()
Get enum name.
public
name() : string
Return values
stringtoArray()
Get enums.
public
static toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>toLabels()
Get enum labels.
public
static toLabels() : array<string|int, string>
Return values
array<string|int, string>toValues()
Get enum values.
public
static toValues() : array<string|int, int|string>
Return values
array<string|int, int|string>value()
Get enum value.
public
value() : string|int
Return values
string|intgetCache()
Get cache array.
private
static getCache(string $index) : array<string|int, mixed>
Parameters
- $index : string
Return values
array<string|int, mixed>getCustomDefinitions()
Get custom constants.
private
static getCustomDefinitions() : array<string|int, mixed>
Return values
array<string|int, mixed>getLabelsConstant()
Fetch the LABELS constant if exists.
private
static getLabelsConstant() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullinitCache()
Init cache if needed.
private
static initCache() : void
setCache()
Set cache array.
private
static setCache(string $index, array<string|int, mixed> $items) : void
Parameters
- $index : string
- $items : array<string|int, mixed>