Resolver
class Winter\Storm\Halcyon\Datasource\Resolver
implements
Winter\Storm\Halcyon\Datasource\ResolverInterface
Properties
protected
$datasources
:
array
= []
All of the registered datasources.
protected $default : string | null
The default datasource name.
Methods
public
__construct (array $datasources = []
)
Create a new datasource resolver instance.
Parameters
Property | Type | Description |
---|---|---|
$datasources | array |
array
|
Returns
mixed
public addDatasource (string $name, Winter\Storm\Halcyon\Datasource\DatasourceInterface $datasource) : void
Adds a datasource to the resolver.
Parameters
Property | Type | Description |
---|---|---|
$name | string |
string
|
$datasource | Winter\Storm\Halcyon\Datasource\DatasourceInterface |
Winter\Storm\Halcyon\Datasource\DatasourceInterface
|
Returns
void
public
datasource ($name = null
)
: Winter\Storm\Halcyon\Datasource\DatasourceInterface
Get a datasource instance by name.
Parameters
Property | Type | Description |
---|---|---|
$name | mixed |
mixed
|
Returns
Winter\Storm\Halcyon\Datasource\DatasourceInterface
public getDefaultDatasource () : string | null
Gets the default datasource name.
Returns
string | null
public hasDatasource (string $name) : bool
Returns if the given datasource name exists.
Parameters
Property | Type | Description |
---|---|---|
$name | string |
string
|
Returns
bool
public setDefaultDatasource (string $name) : void
Sets the default datasource name.
Parameters
Property | Type | Description |
---|---|---|
$name | string |
string
|
Returns
void
← Previous page
Winter\Storm\Halcyon\Datasource\FileDatasource
Next page →
Winter\Storm\Halcyon\Datasource\ResolverInterface
Copyright © 2024 Winter CMS