DataSourceRequest
A query against a named {@see \Milpa\Live\Contracts\Data\DataSourceInterface}, as issued by a component (e.g. an autocomplete's search-as-you-type). `$limit` is a request, not a guarantee — a data source MAY return fewer items and MUST report via {@see DataSourceResult::$meta} whether the result was truncated.
DataSourceRequest::__construct()
public function __construct(string $source, string $componentId, string $query = '', int $limit = 20, array $filters = [], array $context = []):Parameters
| Name | Type | Description |
|---|---|---|
| $source | string | The target data source's name, matched via {@see \Milpa\Live\Contracts\Data\DataSourceInterface::supports()}. |
| $componentId | string | The requesting component instance's id. |
| $query | string | Free-text search term; an empty string means "no filtering by text". |
| $limit | int | Maximum number of items requested. |
| $filters | array<string, mixed> | Additional source-specific filter criteria beyond `$query`. |
| $context | array<string, mixed> | Caller-defined extra context the data source may need to resolve the query. |