| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | namespace LaravelUi5\OData\Protocol\Planning; |
| 6: | |
| 7: | use LaravelUi5\OData\Edm\Contracts\Container\EntitySetInterface; |
| 8: | |
| 9: | /** |
| 10: | * Describes a chain of intermediate single-entity navigations that must be |
| 11: | * resolved at execution time to determine the parent entity for the final |
| 12: | * navigation segment. |
| 13: | * |
| 14: | * Example: /Projects(202)/customer/contact_customer |
| 15: | * rootSet = Projects |
| 16: | * rootKey = {id: 202} |
| 17: | * steps = ['customer'] ← intermediate BelongsTo/HasOne nav props |
| 18: | * finalNav = 'contact_customer' ← the final nav prop (on the resolved parent) |
| 19: | */ |
| 20: | final readonly class NavigationAnchor |
| 21: | { |
| 22: | /** |
| 23: | * @param EntitySetInterface $rootSet The starting entity set (e.g. Projects). |
| 24: | * @param KeyExpression $rootKey The key of the root entity (e.g. id=202). |
| 25: | * @param list<string> $steps Intermediate navigation property names to follow. |
| 26: | * @param string $finalNav The final navigation property name on the resolved parent. |
| 27: | */ |
| 28: | public function __construct( |
| 29: | public EntitySetInterface $rootSet, |
| 30: | public KeyExpression $rootKey, |
| 31: | public array $steps, |
| 32: | public string $finalNav, |
| 33: | ) {} |
| 34: | } |
| 35: |