1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace LaravelUi5\OData\Edm\Contracts\Type;
6:
7: use LaravelUi5\OData\Edm\Contracts\AnnotatableInterface;
8: use LaravelUi5\OData\Edm\Contracts\AnnotationTargetInterface;
9: use LaravelUi5\OData\Edm\EdmPrimitiveType;
10:
11: /**
12: * An enumeration type, defining a set of named integer constants.
13: *
14: * EnumTypes may be used as the type of a structural property. The
15: * underlying storage type is always one of the signed or unsigned
16: * integer primitives. Flags enums allow bitwise combination of
17: * member values.
18: *
19: * @see OData CSDL XML v4.01 §10 (Enumeration Type)
20: */
21: interface EnumTypeInterface extends TypeInterface, AnnotatableInterface, AnnotationTargetInterface
22: {
23: /**
24: * The primitive integer type used to store member values.
25: *
26: * Must be one of: Edm.Byte, Edm.SByte, Edm.Int16, Edm.Int32,
27: * Edm.Int64. Defaults to Edm.Int32 when absent in CSDL.
28: *
29: * @see OData CSDL XML v4.01 §10.1
30: */
31: public function getUnderlyingType(): EdmPrimitiveType;
32:
33: /**
34: * Whether this enum supports bitwise combination of its members.
35: *
36: * @see OData CSDL XML v4.01 §10.2
37: */
38: public function isFlags(): bool;
39:
40: /**
41: * All declared members of this enumeration, in document order.
42: *
43: * @return list<EnumMemberInterface>
44: */
45: public function getMembers(): array;
46:
47: /**
48: * Returns the member with the given name, or null if absent.
49: */
50: public function getMember(string $name): ?EnumMemberInterface;
51: }
52: