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: use LaravelUi5\OData\Edm\Contracts\Type\EntityTypeInterface;
11:
12: /**
13: * An entity set — a named, addressable collection of entity instances
14: * within an entity container.
15: *
16: * Entity sets are the primary runtime collections exposed by an OData
17: * service. Each entity set is typed by a single entity type and may
18: * declare navigation property bindings that resolve navigation targets
19: * to other entity sets or singletons within the container.
20: *
21: * @see OData CSDL XML v4.01 §13.2 (Entity Set)
22: */
23: interface EntitySetInterface extends NamedElementInterface, AnnotatableInterface, AnnotationTargetInterface
24: {
25: /**
26: * The entity type of the elements in this set.
27: */
28: public function getEntityType(): EntityTypeInterface;
29:
30: /**
31: * Whether this entity set is included in the service document.
32: * Defaults to true when absent in CSDL.
33: */
34: public function isIncludedInServiceDocument(): bool;
35:
36: /**
37: * Navigation property bindings declared on this entity set.
38: *
39: * Each binding maps a navigation property path to a target entity
40: * set or singleton within the same container. The path may include
41: * type-cast segments for polymorphic navigation scenarios.
42: *
43: * Returns an empty array when no bindings are declared.
44: *
45: * @return list<NavigationPropertyBindingInterface>
46: * @see OData CSDL XML v4.01 §13.4
47: */
48: public function getNavigationPropertyBindings(): array;
49:
50: /**
51: * Returns the navigation property binding for the given path,
52: * or null when no binding for that path is declared.
53: */
54: public function getNavigationPropertyBinding(string $path): ?NavigationPropertyBindingInterface;
55: }
56: