1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace LaravelUi5\OData\Edm\Contracts\Container;
6:
7: use LaravelUi5\OData\Edm\Contracts\AnnotatableInterface;
8: use LaravelUi5\OData\Edm\Contracts\AnnotationTargetInterface;
9: use LaravelUi5\OData\Edm\Contracts\NamedElementInterface;
10:
11: /**
12: * The entity container — the single runtime context that groups all
13: * addressable resources of an OData service.
14: *
15: * Every OData service exposes exactly one entity container in its
16: * metadata document. The container holds entity sets, singletons, and
17: * function imports. A container may extend another container defined
18: * in a referenced schema, inheriting its members.
19: *
20: * The container is the root from which a query planner resolves all
21: * resource addresses. Navigation property bindings on entity sets and
22: * singletons are resolved within the scope of this container.
23: *
24: * @see OData CSDL XML v4.01 §13 (Entity Container)
25: */
26: interface EntityContainerInterface extends NamedElementInterface, AnnotatableInterface, AnnotationTargetInterface
27: {
28: /**
29: * All entity sets in this container.
30: *
31: * @return list<EntitySetInterface>
32: */
33: public function getEntitySets(): array;
34:
35: /**
36: * Returns the entity set with the given simple name, or null
37: * when not found.
38: */
39: public function getEntitySet(string $name): ?EntitySetInterface;
40:
41: /**
42: * All singletons in this container.
43: *
44: * @return list<SingletonInterface>
45: */
46: public function getSingletons(): array;
47:
48: /**
49: * Returns the singleton with the given simple name, or null
50: * when not found.
51: */
52: public function getSingleton(string $name): ?SingletonInterface;
53:
54: /**
55: * All function imports in this container.
56: *
57: * @return list<FunctionImportInterface>
58: */
59: public function getFunctionImports(): array;
60:
61: /**
62: * Returns the function import with the given simple name, or null
63: * when not found.
64: *
65: * When multiple overloads of the same function are imported under
66: * different names, each import is retrieved by its own name.
67: */
68: public function getFunctionImport(string $name): ?FunctionImportInterface;
69:
70: /**
71: * The qualified name of the container this container extends,
72: * or null when this is a root container.
73: *
74: * Extension inheritance is resolved by the schema builder; this
75: * interface reflects only the declared extension target name.
76: *
77: * @see OData CSDL XML v4.01 §13.1
78: */
79: public function getExtendsName(): ?string;
80: }
81: