DataSourceInterface
A named source of list data (e.g. for an autocomplete or data table) a component can query at request time. Implementations are looked up by name through a {@see DataSourceRegistryInterface} rather than injected directly, so a component's markup/props can name a data source without the component needing a compile-time dependency on it.
DataSourceInterface::supports()
abstract public function supports(string $source): boolWhether this data source answers to the given `source` name. Used by {@see DataSourceRegistryInterface::resolve()} to dispatch by name instead of every call site hand-wiring a specific source.
Parameters
| Name | Type | Description |
|---|---|---|
| $source | string |
DataSourceInterface::resolve()
abstract public function resolve(Milpa\Live\ValueObjects\DataSourceRequest $request): Milpa\Live\ValueObjects\DataSourceResultResolves the request (query/filters/pagination) against this data source's underlying data and returns the matching items.
Parameters
| Name | Type | Description |
|---|---|---|
| $request | Milpa\Live\ValueObjects\DataSourceRequest |