PHP Class Yosymfony\Spress\Core\DataSource\DataSourceManager

Author: Victor Puertas ([email protected])
Mostrar archivo Open project: spress/spress Class Usage Examples

Public Methods

Method Description
__construct ( ) Constructor.
addDataSource ( string $name, AbstractDataSource $dataSource ) Adds a new data source.
clearDataSource ( ) Clears all data sources registered.
getDataSource ( $name ) : AbstractDataSource Gets a data source.
getDataSourceNames ( ) : string[] Gets the name of the registered data sources.
getIncludes ( ) : array Returns the list of items with type "include".
getItems ( ) : array Returns the list of items.
getLayouts ( ) : array Returns the list of items with type "layout".
hasDataSource ( string $name ) : boolean Checks if a data source exists.
load ( ) Load the items from the registered data sources.
removeDataSource ( string $name ) Removes a data source.
setDataSource ( string $name, AbstractDataSource $dataSource ) Sets a data source.

Private Methods

Method Description
initialize ( )
processIncludes ( array $items, $dataSourceName )
processItems ( array $items, $dataSourceName )
processLayouts ( array $items, $dataSourceName )

Method Details

__construct() public method

Constructor.
public __construct ( )

addDataSource() public method

Adds a new data source.
public addDataSource ( string $name, AbstractDataSource $dataSource )
$name string The name of the data source
$dataSource AbstractDataSource

clearDataSource() public method

Clears all data sources registered.
public clearDataSource ( )

getDataSource() public method

Gets a data source.
public getDataSource ( $name ) : AbstractDataSource
return AbstractDataSource

getDataSourceNames() public method

Gets the name of the registered data sources.
public getDataSourceNames ( ) : string[]
return string[]

getIncludes() public method

Returns the list of items with type "include".
public getIncludes ( ) : array
return array

getItems() public method

Returns the list of items.
public getItems ( ) : array
return array

getLayouts() public method

Returns the list of items with type "layout".
public getLayouts ( ) : array
return array

hasDataSource() public method

Checks if a data source exists.
public hasDataSource ( string $name ) : boolean
$name string The name of the data source
return boolean

load() public method

Load the items from the registered data sources.
public load ( )

removeDataSource() public method

Removes a data source.
public removeDataSource ( string $name )
$name string The name of the data source

setDataSource() public method

Sets a data source.
public setDataSource ( string $name, AbstractDataSource $dataSource )
$name string The name of the data source
$dataSource AbstractDataSource