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: * A singleton — a named, addressable single entity instance within
14: * an entity container.
15: *
16: * Unlike entity sets, singletons always refer to exactly one entity
17: * instance. They are used for concepts like "Me" (the current user)
18: * or "DefaultSettings". Singletons carry navigation property bindings
19: * in the same way entity sets do.
20: *
21: * @see OData CSDL XML v4.01 §13.3 (Singleton)
22: */
23: interface SingletonInterface extends NamedElementInterface, AnnotatableInterface, AnnotationTargetInterface
24: {
25: /**
26: * The entity type of this singleton's instance.
27: */
28: public function getEntityType(): EntityTypeInterface;
29:
30: /**
31: * Navigation property bindings declared on this singleton.
32: *
33: * Returns an empty array when no bindings are declared.
34: *
35: * @return list<NavigationPropertyBindingInterface>
36: * @see OData CSDL XML v4.01 §13.4
37: */
38: public function getNavigationPropertyBindings(): array;
39:
40: /**
41: * Returns the navigation property binding for the given path,
42: * or null when no binding for that path is declared.
43: */
44: public function getNavigationPropertyBinding(string $path): ?NavigationPropertyBindingInterface;
45: }
46: