PHP Class Yosymfony\Spress\Core\DataSource\AbstractDataSource

Data sources can load site data from certain locations.
Author: Victor Puertas ([email protected])
Show file Open project: spress/spress

Protected Properties

Property Type Description
$isConfigured
$params
$referenceCounter

Public Methods

Method Description
__construct ( array $params = [] ) Constructor.
addItem ( Yosymfony\Spress\Core\DataSource\ItemInterface $item ) Creates a new item or layout in the data source.
addUse ( ) Marks as used the data source.
configure ( ) This method is used for setting up a site’s data source for the first time.
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".
load ( ) Loads the data source.
process ( ) All data source data manipulations and queries.
removeUse ( ) Marks as unused the data source.
setUp ( ) Brings up the connections to the data.
tearDown ( ) Brings down the connections to the data.

Method Details

__construct() public method

Constructor.
public __construct ( array $params = [] )
$params array Params for initialize the data source

addItem() public method

Creates a new item or layout in the data source.
public addItem ( Yosymfony\Spress\Core\DataSource\ItemInterface $item )
$item Yosymfony\Spress\Core\DataSource\ItemInterface

addUse() public method

This method increases the internal reference count. When the internal reference count goes from 0 to 1 setUp method is invoked.
public addUse ( )

configure() public method

This method is used for setting up a site’s data source for the first time.
public configure ( )

getIncludes() abstract public method

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

getItems() abstract public method

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

getLayouts() abstract public method

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

load() public method

Loads the data source.
public load ( )

process() public method

All data source data manipulations and queries.
public process ( )

removeUse() public method

This method decreases the internal reference count. When the internal reference count is 0 tearDown method is invoked.
public removeUse ( )

setUp() public method

e.g: this is the ideal place to connect to the database.
public setUp ( )

tearDown() public method

e.g: a database connection established in setUp should be closed in this method.
public tearDown ( )

Property Details

$isConfigured protected property

protected $isConfigured

$params protected property

protected $params

$referenceCounter protected property

protected $referenceCounter