ArrayDataSource
A {@see DataSourceInterface} backed by a fixed, in-process PHP array — the simplest data source, for static lookups, fixtures, and tests. Matches against `label`/`value`/`search` (case-insensitive substring), truncated to {@see DataSourceRequest::$limit}.
ArrayDataSource::__construct()
public function __construct(string $name, array $items):Parameters
| Name | Type | Description |
|---|---|---|
| $name | string | |
| $items | array<int, array<string, mixed>> |
ArrayDataSource::supports()
public function supports(string $source): boolTrue when `$source` matches this data source's registered name.
Parameters
| Name | Type | Description |
|---|---|---|
| $source | string |
ArrayDataSource::resolve()
public function resolve(Milpa\Live\ValueObjects\DataSourceRequest $request): Milpa\Live\ValueObjects\DataSourceResultFilters `$items` by {@see DataSourceRequest::$query} (case-insensitive substring match against `label`/`value`/`search`), then truncates to {@see DataSourceRequest::$limit}; `$result->meta['truncated']` reports whether the match set was larger than the returned page.
Parameters
| Name | Type | Description |
|---|---|---|
| $request | Milpa\Live\ValueObjects\DataSourceRequest |