| Methods |
public
|
__construct(
string $namespace,
string $name,
EdmPrimitiveType $underlyingType = EdmPrimitiveType::Int32,
bool $isFlags = false,
list<EnumMemberInterface> $members = [],
list<AnnotationInterface> $annotations = [],
)
|
#
|
public
static
|
fromBackedEnum(string $namespace, class-string<BackedEnum> $enumClass): self
Build an EnumType from a PHP int-backed enum class-string.
Build an EnumType from a PHP int-backed enum class-string.
The EDM short name is derived from the PHP short class name. The
underlying type is fixed at Edm.Int32 — matches OData v4 default
and covers all consumer values today. Members are emitted in
declaration order using PHP case names (display labels are an
i18n concern, not the engine's).
String-backed and pure enums are rejected — OData v4 EnumTypes
are integer-keyed.
|
#
|
public
|
getName(): string
The unqualified name of this element within its parent scope.
The unqualified name of this element within its parent scope.
Must conform to the OData SimpleIdentifier production rule:
a non-empty string of at most 128 characters, starting with
a letter or underscore, followed by letters, digits, or underscores.
Implements
|
#
|
public
|
getQualifiedName(): string
The fully qualified name of this type including its namespace,
e.g. "MyService.Customer" or "Edm.String".
The fully qualified name of this type including its namespace,
e.g. "MyService.Customer" or "Edm.String".
Implements
|
#
|
public
|
getUnderlyingType(): EdmPrimitiveType
The primitive integer type used to store member values.
The primitive integer type used to store member values.
Must be one of: Edm.Byte, Edm.SByte, Edm.Int16, Edm.Int32,
Edm.Int64. Defaults to Edm.Int32 when absent in CSDL.
Implements
|
#
|
public
|
isFlags(): bool
Whether this enum supports bitwise combination of its members.
Whether this enum supports bitwise combination of its members.
Implements
|
#
|
public
|
getMembers(): array
All declared members of this enumeration, in document order.
All declared members of this enumeration, in document order.
Implements
|
#
|
public
|
getMember(string $name): ?EnumMemberInterface
Returns the member with the given name, or null if absent.
Returns the member with the given name, or null if absent.
Implements
|
#
|