VERTICAL
VERTICAL = null
$name : string
$ordinal : int
$values : array<string,array<string,static>>
$allValuesLoaded : array<string,bool>
$constants : array<string,array>
valueOf(string $name) : static
Returns an enum with the specified name.
The name must match exactly an identifier used to declare an enum in this type (extraneous whitespace characters are not permitted).
string | $name |
if the enum has no constant with the specified name
name() : string
Returns the name of this enum constant, exactly as declared in its enum declaration.
Most programmers should use the {@see \DASPRiD\Enum\self::__toString()} method in preference to this one, as the toString method may return a more user-friendly name. This method is designed primarily for use in specialized situations where correctness depends on getting the exact name, which will not vary from release to release.
ordinal() : int
Returns the ordinal of this enumeration constant (its position in its enum declaration, where the initial constant is assigned an ordinal of zero).
Most programmers will have no use for this method. It is designed for use by sophisticated enum-based data structures.
compareTo(self $other) : int
Compares this enum with the specified object for order.
Returns negative integer, zero or positive integer as this object is less than, equal to or greater than the specified object.
Enums are only comparable to other enums of the same type. The natural order implemented by this method is the order in which the constants are declared.
self | $other |
if the passed enum is not of the same type
__construct() : mixed
The constructor is private by default to avoid arbitrary enum creation.
When creating your own constructor for a parameterized enum, make sure to declare it as protected, so that the static methods are able to construct it. Avoid making it public, as that would allow creation of non-singleton enum instances.