DataSourceRegistryInterface
Resolves a {@see DataSourceInterface} by name via a register + supports- based lookup — the same pattern {@see \Milpa\Live\Contracts\Rendering\ComponentRendererRegistryInterface} and {@see \Milpa\Live\Contracts\Tui\TuiNodeRendererRegistryInterface} use for their own targets.
DataSourceRegistryInterface::register()
abstract public function register(Milpa\Live\Contracts\Data\DataSourceInterface $source): voidRegisters a data source. Implementations that keep an ordered list and resolve by first match SHOULD prefer the most recently registered source when more than one claims to {@see DataSourceInterface::supports()} the same name.
Parameters
| Name | Type | Description |
|---|---|---|
| $source | Milpa\Live\Contracts\Data\DataSourceInterface |
DataSourceRegistryInterface::resolve()
abstract public function resolve(string $source): Milpa\Live\Contracts\Data\DataSourceInterfaceLooks up the data source that {@see DataSourceInterface::supports()} the given name.
Parameters
| Name | Type | Description |
|---|---|---|
| $source | string |
Throws
\RuntimeException If no registered source supports `$source`.