1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace LaravelUi5\OData\Edm\Contracts;
6:
7: use LaravelUi5\OData\Edm\Contracts\Container\EntityContainerInterface;
8:
9: /**
10: * The EDMX document — the root of the entire CSDL model.
11: *
12: * An EDMX document wraps one or more schemas and the single entity
13: * container that defines the service's runtime resources. It is the
14: * entry point for any consumer of the model, whether that is a
15: * serialiser producing XML or JSON metadata, a query planner building
16: * a query plan from a parsed OData URL, or a driver mapping the model
17: * to a database schema.
18: *
19: * In the fully-resolved model that this interface describes, all cross-
20: * schema references have already been resolved to object references by
21: * the schema builder. There are no unresolved qualified names at this
22: * level.
23: *
24: * @see OData CSDL XML v4.01 §4 (CSDL XML Document)
25: */
26: interface EdmxInterface
27: {
28: /**
29: * The OData version this document conforms to.
30: *
31: * For documents conforming to this specification the value is
32: * "4.0" or "4.01".
33: *
34: * @see OData CSDL XML v4.01 §4
35: */
36: public function getVersion(): string;
37:
38: /**
39: * All external documents referenced by this metadata document,
40: * in document order.
41: *
42: * References record which vocabulary documents were consulted
43: * when the model was built. A serialiser emits them as
44: * <edmx:Reference> elements so that clients can locate the
45: * vocabulary definitions their annotations refer to.
46: *
47: * @return list<ReferenceInterface>
48: * @see OData CSDL XML v4.01 §4.1
49: */
50: public function getReferences(): array;
51:
52: /**
53: * Returns the reference for the given URI, or null when no
54: * reference with that URI is declared.
55: */
56: public function getReference(string $uri): ?ReferenceInterface;
57:
58: /**
59: * All schemas contained in or referenced by this document,
60: * keyed by their namespace.
61: *
62: * @return array<string, SchemaInterface>
63: */
64: public function getSchemas(): array;
65:
66: /**
67: * Returns the schema with the given namespace, or null when
68: * not found.
69: */
70: public function getSchema(string $namespace): ?SchemaInterface;
71:
72: /**
73: * The single entity container of this service.
74: *
75: * Every well-formed OData service metadata document contains
76: * exactly one entity container across all its schemas.
77: */
78: public function getEntityContainer(): EntityContainerInterface;
79: }
80: