AbstractMultiton
class AbstractMultiton implements MultitonInterface
Abstract base class for Java-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.
Returns the string key of this member.
Check if this member is in the specified list of members.
Check if this member is in the specified list of members.
Returns a string representation of this member.
Details
at line 38
final static
AbstractMultiton
memberByKey(
string $key,
boolean|null $isCaseSensitive = null)
Returns a single member by string key.
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.
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.
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.
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.
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.
at line 217
final static
AbstractMultiton
memberByPredicate(
callable $predicate)
Returns a single member by predicate callback.
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.
at line 263
final static
array<string,static>
members()
Returns an array of all members in this multiton.
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.
at line 326
final static
array<string,static>
membersByPredicate(
callable $predicate)
Returns a set of members by predicate callback.
at line 350
final static
AbstractMultiton
__callStatic(
string $key,
array $arguments)
Maps static method calls to members.
at line 362
final
string
key()
Returns the string key of this member.
at line 378
final
boolean
anyOf(
MultitonInterface $a,
MultitonInterface $b)
Check if this member is in the specified list of members.
at line 392
final
boolean
anyOfArray(
array $values)
Check if this member is in the specified list of members.
at line 406
string
__toString()
Returns a string representation of this member.