| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | namespace LaravelUi5\OData\Service\Contracts; |
| 6: | |
| 7: | /** |
| 8: | * A serializable binding that knows how to create a resolver at runtime. |
| 9: | * |
| 10: | * ResolverBindings are collected during schema configuration and persisted |
| 11: | * in the ResolverMap. On warm boot, the cached map calls createResolver() |
| 12: | * to instantiate resolvers without re-running configure() or discovery. |
| 13: | * |
| 14: | * Implementations must be serializable as plain PHP (only scalar properties |
| 15: | * and class-string references — no closures, no object graphs). |
| 16: | */ |
| 17: | interface ResolverBindingInterface |
| 18: | { |
| 19: | /** |
| 20: | * Create the entity set resolver for this binding. |
| 21: | */ |
| 22: | public function createResolver(): EntitySetResolverInterface; |
| 23: | |
| 24: | /** |
| 25: | * The **authored** class-string that backs this entity set — the class a consumer |
| 26: | * reflects on to read class attributes (permissions, capabilities, annotations). |
| 27: | * |
| 28: | * This is the source the developer wrote, NOT necessarily the runtime resolver: |
| 29: | * for a model-backed set it is the Eloquent **model** (the resolver is the generic |
| 30: | * EloquentEntitySetResolver); for a custom or source-backed set it is that class. |
| 31: | * Returns `null` when there is no authored class to reflect on — e.g. a raw |
| 32: | * table/view binding. |
| 33: | * |
| 34: | * @return class-string|null |
| 35: | */ |
| 36: | public function getSourceClass(): ?string; |
| 37: | } |
| 38: |