| 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\FunctionInterface; |
| 10: | use LaravelUi5\OData\Edm\Contracts\NamedElementInterface; |
| 11: | |
| 12: | /** |
| 13: | * A function import — a container-level entry point that exposes an |
| 14: | * unbound function overload as an addressable resource. |
| 15: | * |
| 16: | * Function imports are the mechanism by which unbound functions become |
| 17: | * callable from the service root. A function import references a |
| 18: | * function defined in a schema and optionally declares which entity |
| 19: | * set in the container holds its return entities. |
| 20: | * |
| 21: | * Note: only unbound functions may be exposed as function imports. |
| 22: | * Bound functions are invoked directly via the entity set or singleton |
| 23: | * they are bound to and do not appear here. |
| 24: | * |
| 25: | * @see OData CSDL XML v4.01 §13.6 (Function Import) |
| 26: | */ |
| 27: | interface FunctionImportInterface extends NamedElementInterface, AnnotatableInterface, AnnotationTargetInterface |
| 28: | { |
| 29: | /** |
| 30: | * The function overload this import exposes. |
| 31: | * |
| 32: | * Always an unbound overload — bound functions are not importable. |
| 33: | */ |
| 34: | public function getFunction(): FunctionInterface; |
| 35: | |
| 36: | /** |
| 37: | * The entity set whose instances are returned by this function |
| 38: | * import, expressed as the simple name of the entity set within |
| 39: | * the same container, or null when the function does not return |
| 40: | * entities or the entity set is not statically known. |
| 41: | * |
| 42: | * This is a string rather than a resolved EntitySetInterface |
| 43: | * because the spec allows this value to be a path expression |
| 44: | * evaluated at runtime. For static resolution during query |
| 45: | * planning, resolve this name against the parent container. |
| 46: | * |
| 47: | * @see OData CSDL XML v4.01 §13.6 |
| 48: | */ |
| 49: | public function getEntitySet(): ?string; |
| 50: | |
| 51: | /** |
| 52: | * Whether this function import is included in the service document. |
| 53: | * Defaults to false when absent in CSDL. |
| 54: | * |
| 55: | * @see OData CSDL XML v4.01 §13.6 |
| 56: | */ |
| 57: | public function isIncludedInServiceDocument(): bool; |
| 58: | } |
| 59: |