PHP Class Backend\Modules\Pages\Engine\CacheBuilder

Show file Open project: forkcms/forkcms Class Usage Examples

Protected Properties

Property Type Description
$blocks
$cache Psr\Cache\CacheItemPoolInterface
$database SpoonDatabase
$sitemapId

Public Methods

Method Description
__construct ( SpoonDatabase $database, Psr\Cache\CacheItemPoolInterface $cache )
buildCache ( string $language ) Builds the pages cache
getKeys ( string $language ) : array
getNavigation ( string $language ) : array

Protected Methods

Method Description
dumpEditorLinkList ( array $navigation, array $keys, string $language ) : string Save the link list
getBlocks ( ) : array Returns an array containing all extras
getCacheHeader ( string $itContainsMessage ) : string Gets the header for cache files
getData ( string $language ) : array Fetches all data from the database
getOrder ( array $navigation, string $type = 'page', integer $parentId, array $order = [] ) : array Get the order
getPageData ( &$keys, array $page, string $language ) : array Fetches the pagedata for a certain page array It also adds the page data to the keys array
getPageExtraBlocks ( $page ) : array
getPageTreeType ( $page, &$pageData ) : string
getSitemapId ( ) : string Returns an array containing all widgets

Method Details

__construct() public method

public __construct ( SpoonDatabase $database, Psr\Cache\CacheItemPoolInterface $cache )
$database SpoonDatabase
$cache Psr\Cache\CacheItemPoolInterface

buildCache() public method

Builds the pages cache
public buildCache ( string $language )
$language string The language to build the cache for.

getBlocks() protected method

Returns an array containing all extras
protected getBlocks ( ) : array
return array

getCacheHeader() protected method

Gets the header for cache files
protected getCacheHeader ( string $itContainsMessage ) : string
$itContainsMessage string A message about the content of the file
return string A comment to be used in the cache file

getData() protected method

Fetches all data from the database
protected getData ( string $language ) : array
$language string
return array tupple containing keys and navigation

getKeys() public method

public getKeys ( string $language ) : array
$language string
return array

getNavigation() public method

public getNavigation ( string $language ) : array
$language string
return array

getOrder() protected method

Get the order
protected getOrder ( array $navigation, string $type = 'page', integer $parentId, array $order = [] ) : array
$navigation array The navigation array.
$type string The type of navigation.
$parentId integer The Id to start from.
$order array The array to hold the order.
return array

getPageData() protected method

Fetches the pagedata for a certain page array It also adds the page data to the keys array
protected getPageData ( &$keys, array $page, string $language ) : array
$page array
$language string
return array An array containing more data for the page

getPageExtraBlocks() protected method

protected getPageExtraBlocks ( $page ) : array
$page array
return array

getPageTreeType() protected method

protected getPageTreeType ( $page, &$pageData ) : string
$page array
$pageData array
return string

getSitemapId() protected method

Returns an array containing all widgets
protected getSitemapId ( ) : string
return string

Property Details

$blocks protected property

protected $blocks

$cache protected property

protected CacheItemPoolInterface,Psr\Cache $cache
return Psr\Cache\CacheItemPoolInterface

$database protected property

protected SpoonDatabase $database
return SpoonDatabase

$sitemapId protected property

protected $sitemapId