1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace LaravelUi5\OData\Edm\Contracts;
6:
7: /**
8: * The entity set path of a bound function overload.
9: *
10: * When a bound function returns entities, the entity set path tells
11: * the service which entity set in the container those entities belong
12: * to. The path is always a two-segment expression: the name of the
13: * binding parameter followed by the name of a navigation property on
14: * the binding parameter's type.
15: *
16: * This interface exists to support machine resolution of the return
17: * entity set during query plan generation: a planner can retrieve the
18: * binding parameter type, navigate to the declared navigation property,
19: * and from there resolve the target entity set via the container's
20: * navigation property bindings.
21: *
22: * @see OData CSDL XML v4.01 ยง12.6 (Entity Set Path)
23: */
24: interface EntitySetPathInterface
25: {
26: /**
27: * The name of the binding parameter, i.e. the first segment of
28: * the path expression.
29: *
30: * This name corresponds to the first parameter of the function
31: * overload as returned by FunctionInterface::getParameters().
32: */
33: public function getBindingParameterName(): string;
34:
35: /**
36: * The name of the navigation property on the binding parameter's
37: * type, i.e. the second segment of the path expression.
38: *
39: * Resolving this navigation property on the binding parameter's
40: * entity type and then looking up the matching navigation property
41: * binding on the function's container member yields the concrete
42: * entity set that holds the function's return values.
43: */
44: public function getNavigationPropertyName(): string;
45:
46: /**
47: * The full path expression as it appears in CSDL, e.g.
48: * "bindingParameter/Orders".
49: *
50: * Provided as a convenience for serialisation and logging;
51: * prefer the typed accessors above for programmatic resolution.
52: */
53: public function __toString(): string;
54: }
55: