| 1: | <?php |
| 2: | |
| 3: | declare(strict_types=1); |
| 4: | |
| 5: | namespace LaravelUi5\OData\Edm\Contracts\Annotation; |
| 6: | |
| 7: | /** |
| 8: | * A collection annotation value — an ordered list of annotation values. |
| 9: | * |
| 10: | * Collections appear wherever a term expects multiple values, e.g. |
| 11: | * UI.LineItem is a collection of UI.DataField records, and |
| 12: | * Capabilities.FilterRestrictions.FilterExpressionRestrictions is a |
| 13: | * collection of restriction records. |
| 14: | * |
| 15: | * Items within a collection are heterogeneous in principle — each item |
| 16: | * is an AnnotationValueInterface and may be a constant, a record, or |
| 17: | * a nested collection. In practice, well-formed vocabulary annotations |
| 18: | * use homogeneous collections. |
| 19: | * |
| 20: | * Document order is significant per the CSDL spec and is preserved. |
| 21: | * |
| 22: | * @see OData CSDL XML v4.01 §14.4.6 (Collection) |
| 23: | * @see OData CSDL XML v4.01 §2.4 (XML Document Order) |
| 24: | */ |
| 25: | interface CollectionAnnotationValueInterface extends AnnotationValueInterface |
| 26: | { |
| 27: | /** |
| 28: | * All items in this collection, in document order. |
| 29: | * |
| 30: | * @return list<AnnotationValueInterface> |
| 31: | */ |
| 32: | public function getItems(): array; |
| 33: | |
| 34: | /** |
| 35: | * Whether this collection contains no items. |
| 36: | */ |
| 37: | public function isEmpty(): bool; |
| 38: | |
| 39: | /** |
| 40: | * The number of items in this collection. |
| 41: | */ |
| 42: | public function count(): int; |
| 43: | } |
| 44: |