AbstractEnumeration
class AbstractEnumeration extends AbstractValueMultiton implements EnumerationInterface
Abstract base class for C++ style enumerations.
Methods
Returns a single member by string key.
Returns a single member by string key. Additionally returns a default if no associated member is found.
Returns a single member by string key. Additionally returns null if the supplied key is null.
Returns a single member by comparison with the result of an accessor method.
Returns a single member by comparison with the result of an accessor method. Additionally returns a default if no associated member is found.
Returns a single member by comparison with the result of an accessor method. Additionally returns null if the supplied value is null.
Returns a single member by predicate callback.
Returns a single member by predicate callback. Additionally returns a default if no associated member is found.
Returns an array of all members in this multiton.
Returns a set of members by comparison with the result of an accessor method.
Returns a set of members by predicate callback.
Maps static method calls to members.
Check if this member is in the specified list of members.
Check if this member is in the specified list of members.
Returns a single member by value.
Returns a single member by value. Additionally returns a default if no associated member is found.
Returns a single member by value. Additionally returns null if the supplied value is null.
Returns a set of members matching the supplied value.
Details
in
AbstractMultiton at line 38
final static
AbstractMultiton
memberByKey(
string $key,
boolean|null $isCaseSensitive = null)
Returns a single member by string key.
in
AbstractMultiton at line 55
final static
AbstractMultiton
memberByKeyWithDefault(
string $key,
MultitonInterface $default = null,
boolean|null $isCaseSensitive = null)
Returns a single member by string key. Additionally returns a default if no associated member is found.
in
AbstractMultiton at line 80
final static
AbstractMultiton|null
memberOrNullByKey(
string|null $key,
boolean|null $isCaseSensitive = null)
Returns a single member by string key. Additionally returns null if the supplied key is null.
in
AbstractMultiton at line 100
final static
AbstractMultiton
memberBy(
string $property,
mixed $value,
boolean|null $isCaseSensitive = null)
Returns a single member by comparison with the result of an accessor method.
in
AbstractMultiton at line 136
final static
AbstractMultiton|null
memberByWithDefault(
string $property,
mixed $value,
MultitonInterface $default = null,
boolean|null $isCaseSensitive = null)
Returns a single member by comparison with the result of an accessor method. Additionally returns a default if no associated member is found.
in
AbstractMultiton at line 181
final static
AbstractMultiton|null
memberOrNullBy(
string $property,
mixed $value,
boolean|null $isCaseSensitive = null)
Returns a single member by comparison with the result of an accessor method. Additionally returns null if the supplied value is null.
in
AbstractMultiton at line 217
final static
AbstractMultiton
memberByPredicate(
callable $predicate)
Returns a single member by predicate callback.
in
AbstractMultiton at line 243
final static
AbstractMultiton
memberByPredicateWithDefault(
callable $predicate,
MultitonInterface $default = null)
Returns a single member by predicate callback. Additionally returns a default if no associated member is found.
in
AbstractMultiton at line 263
final static
array<string,static>
members()
Returns an array of all members in this multiton.
in
AbstractMultiton at line 287
final static
array<string,static>
membersBy(
string $property,
mixed $value,
boolean|null $isCaseSensitive = null)
Returns a set of members by comparison with the result of an accessor method.
in
AbstractMultiton at line 326
final static
array<string,static>
membersByPredicate(
callable $predicate)
Returns a set of members by predicate callback.
in
AbstractMultiton at line 350
final static
AbstractMultiton
__callStatic(
string $key,
array $arguments)
Maps static method calls to members.
in
AbstractMultiton at line 362
final
string
key()
Returns the string key of this member.
in
AbstractMultiton at line 378
final
boolean
anyOf(
MultitonInterface $a,
MultitonInterface $b)
Check if this member is in the specified list of members.
in
AbstractMultiton at line 392
final
boolean
anyOfArray(
array $values)
Check if this member is in the specified list of members.
in
AbstractMultiton at line 406
string
__toString()
Returns a string representation of this member.
in
AbstractValueMultiton at line 36
final static
AbstractValueMultiton
memberByValue(
mixed $value,
boolean|null $isCaseSensitive = null)
Returns a single member by value.
in
AbstractValueMultiton at line 53
final static
AbstractValueMultiton
memberByValueWithDefault(
mixed $value,
ValueMultitonInterface $default = null,
boolean|null $isCaseSensitive = null)
Returns a single member by value. Additionally returns a default if no associated member is found.
in
AbstractValueMultiton at line 78
final static
AbstractValueMultiton|null
memberOrNullByValue(
mixed|null $value,
boolean|null $isCaseSensitive = null)
Returns a single member by value. Additionally returns null if the supplied value is null.
in
AbstractValueMultiton at line 95
final static
array<string,static>
membersByValue(
mixed $value,
boolean|null $isCaseSensitive = null)
Returns a set of members matching the supplied value.
in
AbstractValueMultiton at line 107
final
mixed
value()
Returns the value of this member.