1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace LaravelUi5\OData\Edm\Vocabularies;
6:
7: /**
8: * A single vocabulary entry in the build-time catalog.
9: *
10: * Each entry carries everything the generator needs to fetch, parse,
11: * and emit PHP classes for one vocabulary: the remote XML source,
12: * the OData namespace and canonical alias, and the target PHP namespace
13: * under which the generated classes will be placed.
14: *
15: * Example — the SAP UI vocabulary:
16: *
17: * getNamespace() → "com.sap.vocabularies.UI.v1"
18: * getAlias() → "UI"
19: * getUri() → "https://sap.github.io/odata-vocabularies/vocabularies/UI.xml"
20: * getPhpNamespace() → "LaravelUi5\\OData\\Vocabularies\\Ui\\V1"
21: *
22: * Example — the OASIS Core vocabulary:
23: *
24: * getNamespace() → "Org.OData.Core.V1"
25: * getAlias() → "Core"
26: * getUri() → "https://oasis-tcs.github.io/odata-vocabularies/vocabularies/Org.OData.Core.V1.xml"
27: * getPhpNamespace() → "LaravelUi5\\OData\\Vocabularies\\Core\\V1"
28: */
29: interface VocabularyEntryInterface
30: {
31: /**
32: * The full OData namespace of this vocabulary,
33: * e.g. "com.sap.vocabularies.UI.v1".
34: */
35: public function getNamespace(): string;
36:
37: /**
38: * The canonical alias for this vocabulary as used in CSDL documents,
39: * e.g. "UI". This alias is registered in the VocabularyRegistry so
40: * that term names can be resolved at runtime.
41: */
42: public function getAlias(): string;
43:
44: /**
45: * The URI of the vocabulary's CSDL XML source document. The generator
46: * fetches this URI to obtain the Term and ComplexType definitions.
47: */
48: public function getUri(): string;
49:
50: /**
51: * The PHP namespace under which the generator places the generated
52: * classes for this vocabulary, e.g.
53: * "LaravelUi5\\OData\\Vocabularies\\Ui\\V1".
54: *
55: * Generated classes for Terms and ComplexTypes are placed directly
56: * in this namespace. The generator derives the class name from the
57: * Term or ComplexType's simple name.
58: */
59: public function getPhpNamespace(): string;
60:
61: /**
62: * The OData namespaces this vocabulary depends on, in no particular
63: * order. The catalog uses this to validate resolution order at
64: * generation time.
65: *
66: * @return list<string>
67: */
68: public function getDependencies(): array;
69:
70: /**
71: * Build an edmx:Reference for this vocabulary entry.
72: */
73: public function toReference(): \LaravelUi5\OData\Edm\Contracts\ReferenceInterface;
74: }