1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace LaravelUi5\OData\Edm\Contracts\Annotation;
6:
7: /**
8: * A constant annotation value — a single primitive or enum-member
9: * literal that requires no further structural decomposition.
10: *
11: * The kind discriminates the concrete primitive type so that a
12: * serialiser can emit the correct CSDL element or attribute, e.g.
13: * Bool="true", String="...", or <EnumMember>UI.TextArrangement/TextOnly
14: * </EnumMember>.
15: *
16: * Path-like constant expressions (AnnotationPath, NavigationPropertyPath,
17: * PropertyPath, ValuePath) are also represented here because they are
18: * serialised as opaque string literals from the serialiser's perspective.
19: * The kind value identifies which path variant they are.
20: *
21: * @see OData CSDL XML v4.01 §14.3 (Constant Expression)
22: * @see OData CSDL XML v4.01 §14.4.1 (Path Expressions)
23: */
24: interface ConstantAnnotationValueInterface extends AnnotationValueInterface
25: {
26: /**
27: * Discriminator for the concrete primitive kind.
28: *
29: * Valid values mirror the CSDL constant expression element names:
30: * "Binary", "Boolean", "Date", "DateTimeOffset", "Decimal",
31: * "Duration", "EnumMember", "Float", "Guid", "Integer", "String",
32: * "TimeOfDay", "AnnotationPath", "NavigationPropertyPath",
33: * "PropertyPath", "ValuePath".
34: */
35: public function getKind(): string;
36:
37: /**
38: * The value serialised as a string in the type's canonical format.
39: *
40: * For Boolean: "true" or "false".
41: * For EnumMember: the qualified member name, e.g.
42: * "UI.TextArrangement/TextOnly".
43: * For path expressions: the path string as it appears in CSDL.
44: * For all others: the standard OData literal representation.
45: */
46: public function getValue(): string;
47: }
48: