| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | namespace LaravelUi5\OData\Edm\Contracts\Property; |
| 6: | |
| 7: | use LaravelUi5\OData\Edm\Contracts\AnnotatableInterface; |
| 8: | use LaravelUi5\OData\Edm\Contracts\AnnotationTargetInterface; |
| 9: | use LaravelUi5\OData\Edm\Contracts\NamedElementInterface; |
| 10: | use LaravelUi5\OData\Edm\Contracts\Type\TypeFacetsInterface; |
| 11: | use LaravelUi5\OData\Edm\Contracts\Type\TypeInterface; |
| 12: | |
| 13: | /** |
| 14: | * A structural property of an EntityType or ComplexType. |
| 15: | * |
| 16: | * Structural properties hold data values. Their type is always a |
| 17: | * primitive, complex, enum, or type-definition — never an entity type. |
| 18: | * The property carries its type as a fully resolved TypeInterface |
| 19: | * object; the associated facets further constrain the value space. |
| 20: | * |
| 21: | * @see OData CSDL XML v4.01 §7 (Structural Property) |
| 22: | */ |
| 23: | interface PropertyInterface extends NamedElementInterface, AnnotatableInterface, AnnotationTargetInterface |
| 24: | { |
| 25: | /** |
| 26: | * The resolved type of this property. |
| 27: | * |
| 28: | * For collection-valued properties this is the type of each |
| 29: | * individual element; use isCollection() to distinguish. |
| 30: | * |
| 31: | * @see OData CSDL XML v4.01 §7.1 |
| 32: | */ |
| 33: | public function getType(): TypeInterface; |
| 34: | |
| 35: | /** |
| 36: | * Whether this property holds a collection of values rather |
| 37: | * than a single value. |
| 38: | */ |
| 39: | public function isCollection(): bool; |
| 40: | |
| 41: | /** |
| 42: | * The facets constraining this property's type, or null when |
| 43: | * no facets are declared beyond the type's own defaults. |
| 44: | * |
| 45: | * @see OData CSDL XML v4.01 §7.2 |
| 46: | */ |
| 47: | public function getFacets(): ?TypeFacetsInterface; |
| 48: | |
| 49: | /** |
| 50: | * The default value as declared in CSDL, represented as a string |
| 51: | * in the property type's literal format. Null when absent. |
| 52: | * |
| 53: | * @see OData CSDL XML v4.01 §7.2.7 |
| 54: | */ |
| 55: | public function getDefaultValue(): ?string; |
| 56: | } |
| 57: |