CRM V4

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
throws
Error

If provided element are not enums taht extends BaseEnum.

Return values
bool

jsonSerialize()

Serialize to json.

public jsonSerialize() : mixed

label()

Get enum label.

public label() : string
Return values
string

make()

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|null

name()

Get enum name.

public name() : string
Return values
string

toArray()

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|int

getCache()

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>|null

initCache()

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>

        
On this page

Search results