October\Rain\Halcyon\Datasource\Resolver

Implements
  • October\Rain\Halcyon\Datasource\ResolverInterface

Protected Properties

protected array $datasources

datasources registrations

protected string $default

default datasource name


Public Methods

public __construct()

public __construct($datasources = []): void

__construct a new datasource resolver instance

public addDatasource()

public addDatasource($name, $datasource): void

addDatasource to the resolver

public datasource()

public datasource(
    $name = null
): October\Rain\Halcyon\Datasource\DatasourceInterface 

datasource instance

public getDefaultDatasource()

public getDefaultDatasource(): string|null 

getDefaultDatasource name

public hasDatasource()

public hasDatasource($name): bool 

hasDatasource checks if a datasource has been registered

public setDefaultDatasource()

public setDefaultDatasource($name): void

setDefaultDatasource name