1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace LaravelUi5\OData\Edm\Contracts\Type;
6:
7: use LaravelUi5\OData\Edm\Contracts\AnnotatableInterface;
8: use LaravelUi5\OData\Edm\Contracts\Property\PropertyInterface;
9:
10: /**
11: * Common contract for structured types — entity types and complex
12: * types — which hold a named set of structural properties.
13: *
14: * Structured types may derive from a base type of the same kind,
15: * may be declared abstract, and may be open (permitting dynamic
16: * properties beyond those declared in CSDL).
17: *
18: * @see OData CSDL XML v4.01 §3.2 (Structured Types)
19: */
20: interface StructuredTypeInterface extends TypeInterface, AnnotatableInterface
21: {
22: /**
23: * All structural properties declared directly on this type,
24: * not including properties inherited from a base type.
25: *
26: * @return list<PropertyInterface>
27: */
28: public function getDeclaredProperties(): array;
29:
30: /**
31: * Returns a structural property by name, searching this type
32: * and all base types in the inheritance chain.
33: *
34: * Returns null when no property with that name exists anywhere
35: * in the hierarchy.
36: */
37: public function getProperty(string $name): ?PropertyInterface;
38:
39: /**
40: * Whether this type is abstract and may not be instantiated
41: * directly.
42: */
43: public function isAbstract(): bool;
44:
45: /**
46: * Whether this type is open, permitting dynamic properties
47: * whose names and types are not declared in CSDL.
48: */
49: public function isOpen(): bool;
50: }
51: