PHP Class Yosymfony\Spress\Core\DataSource\AbstractDataSource

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

Protected Properties

Свойство Type Description
$isConfigured
$params
$referenceCounter

Méthodes publiques

Méthode 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 méthode

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

addItem() public méthode

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 méthode

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 méthode

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

getIncludes() abstract public méthode

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

getItems() abstract public méthode

Returns the list of items.
abstract public getItems ( ) : array
Résultat array

getLayouts() abstract public méthode

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

load() public méthode

Loads the data source.
public load ( )

process() public méthode

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

removeUse() public méthode

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

setUp() public méthode

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

tearDown() public méthode

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

Property Details

$isConfigured protected_oe property

protected $isConfigured

$params protected_oe property

protected $params

$referenceCounter protected_oe property

protected $referenceCounter