1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace LaravelUi5\OData\Edm\Contracts\Annotation;
6:
7: /**
8: * A single annotation applied to a model element.
9: *
10: * An annotation binds a term to a value and applies that binding to
11: * a specific model element. The term is identified by its qualified
12: * name. An optional qualifier allows multiple annotations of the same
13: * term on the same element to coexist, disambiguated by context —
14: * e.g. a label for a "desktop" qualifier vs. a "mobile" qualifier.
15: *
16: * The value may be absent for terms whose type is implicitly Boolean
17: * and whose presence alone carries the meaning (marker annotations).
18: *
19: * Example — a simple string annotation:
20: *
21: * getTerm() → "Core.Description"
22: * getQualifier() → null
23: * getValue() → ConstantAnnotationValueInterface { kind: "String",
24: * value: "The list of open orders" }
25: *
26: * Example — a record annotation with qualifier:
27: *
28: * getTerm() → "UI.LineItem"
29: * getQualifier() → "Expanded"
30: * getValue() → CollectionAnnotationValueInterface { items: [...] }
31: *
32: * @see OData CSDL XML v4.01 §14.2 (Annotation)
33: */
34: interface AnnotationInterface
35: {
36: /**
37: * The qualified name of the term this annotation applies,
38: * e.g. "Core.Description" or "UI.LineItem".
39: *
40: * The name uses the vocabulary alias as it appears in the CSDL
41: * document, not necessarily the fully qualified namespace form.
42: *
43: * @see OData CSDL XML v4.01 §14.2
44: */
45: public function getTerm(): string;
46:
47: /**
48: * The optional qualifier that disambiguates multiple annotations
49: * of the same term on the same element. Null when absent.
50: *
51: * @see OData CSDL XML v4.01 §14.2.1
52: */
53: public function getQualifier(): ?string;
54:
55: /**
56: * The value of this annotation, or null for marker annotations
57: * whose presence alone is significant.
58: */
59: public function getValue(): ?AnnotationValueInterface;
60: }
61: