| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | namespace LaravelUi5\OData\Edm\Contracts\Type; |
| 6: | |
| 7: | use LaravelUi5\OData\Edm\Contracts\AnnotationTargetInterface; |
| 8: | use LaravelUi5\OData\Edm\Contracts\Property\NavigationPropertyInterface; |
| 9: | |
| 10: | /** |
| 11: | * A complex type — a structured value type without identity. |
| 12: | * |
| 13: | * Complex types are similar to entity types but carry no key. They |
| 14: | * are used to group related structural properties into a reusable |
| 15: | * value object, e.g. an address or a money amount. Unlike entity |
| 16: | * types they can appear as the type of a structural property. |
| 17: | * |
| 18: | * Per OData v4.01 complex types may also carry navigation properties, |
| 19: | * which is why this interface extends StructuredTypeInterface and |
| 20: | * additionally exposes navigation property access. |
| 21: | * |
| 22: | * @see OData CSDL XML v4.01 §9 (Complex Type) |
| 23: | */ |
| 24: | interface ComplexTypeInterface extends StructuredTypeInterface, AnnotationTargetInterface |
| 25: | { |
| 26: | /** |
| 27: | * The base complex type this type derives from, or null for |
| 28: | * a root type. |
| 29: | * |
| 30: | * @see OData CSDL XML v4.01 §9.1 |
| 31: | */ |
| 32: | public function getBaseType(): ?ComplexTypeInterface; |
| 33: | |
| 34: | /** |
| 35: | * All navigation properties declared directly on this complex type. |
| 36: | * |
| 37: | * Navigation properties on complex types are permitted by the spec |
| 38: | * but uncommon. This method returns an empty array for types that |
| 39: | * declare none. |
| 40: | * |
| 41: | * @return list<NavigationPropertyInterface> |
| 42: | */ |
| 43: | public function getDeclaredNavigationProperties(): array; |
| 44: | |
| 45: | /** |
| 46: | * Returns a navigation property by name, searching this type |
| 47: | * and all base types in the inheritance chain. |
| 48: | */ |
| 49: | public function getNavigationProperty(string $name): ?NavigationPropertyInterface; |
| 50: | } |
| 51: |