本文整理汇总了PHP中eZContentCacheManager::clearTemplateBlockCache方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentCacheManager::clearTemplateBlockCache方法的具体用法?PHP eZContentCacheManager::clearTemplateBlockCache怎么用?PHP eZContentCacheManager::clearTemplateBlockCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentCacheManager
的用法示例。
在下文中一共展示了eZContentCacheManager::clearTemplateBlockCache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clearContentCache
static function clearContentCache( $objectIDList, $versionNum = true, $additionalNodeList = false )
{
if ( !is_array($objectIDList) )
{
return false;
}
eZDebug::accumulatorStart( 'check_cache', '', 'Check cache' );
KeZCacheManager::clearObjectViewCache( $objectIDList, $versionNum, $additionalNodeList );
foreach ($objectIDList as $objectID)
{
eZContentCacheManager::clearTemplateBlockCache( $objectID );
}
// Clear cached path strings of content SSL zones.
eZSSLZone::clearCache();
eZDebug::accumulatorStop( 'check_cache' );
return true;
}
示例2: restoreSiteStyle
/**
* Restore site style to given version
*
* @static
*/
public static function restoreSiteStyle()
{
$params = self::getPostParams();
$siteStyleVerParam = isset($params['sitestyle_version']) ? $params['sitestyle_version'] : array();
$siteStyleVerID = isset($siteStyleVerParam['id']) ? $siteStyleVerParam['id'] : null;
$objectID = isset($params['object_id']) ? $params['object_id'] : null;
$siteStyleVersion = ezcsseSiteStyleVersion::fetchObject(ezcsseSiteStyleVersion::definition(), null, array('id' => $siteStyleVerID));
$siteStyle = ezcsseSiteStyle::fetchObject(ezcsseSiteStyle::definition(), null, array('id' => $siteStyleVersion->attribute('sitestyle_id')));
$currentVersion = $siteStyle->attribute('current_version');
$siteStyleDef = ezcsseSiteStyleDefinition::fetchObject(ezcsseSiteStyleDefinition::definition(), null, array('sitestyle_id' => $siteStyleVersion->attribute('sitestyle_id'), 'version' => $siteStyleVersion->attribute('version')));
$style = $siteStyleDef->attribute('style');
$newSiteStyleVersion = new ezcsseSiteStyleVersion();
$newSiteStyleVersion->setAttribute('sitestyle_id', $siteStyle->attribute('id'));
$newSiteStyleVersion->setAttribute('version', $currentVersion + 1);
$newSiteStyleVersion->setAttribute('created', time());
$newSiteStyleVersion->setAttribute('modified', time());
$newSiteStyleVersion->store();
$newSiteStyleDef = new ezcsseSiteStyleDefinition();
$newSiteStyleDef->setAttribute('sitestyle_id', $siteStyle->attribute('id'));
$newSiteStyleDef->setAttribute('version', $currentVersion + 1);
$newSiteStyleDef->setAttribute('style', $style);
$newSiteStyleDef->store();
$siteStyle->setAttribute('current_version', $currentVersion + 1);
$siteStyle->store();
$style = ezcsseStyle::createFromXML($style);
if ($objectID) {
eZContentCacheManager::clearTemplateBlockCache($objectID);
}
return $style->toJSON();
}