本文整理汇总了PHP中Aimeos\MShop\Context\Item\Iface::setCache方法的典型用法代码示例。如果您正苦于以下问题:PHP Iface::setCache方法的具体用法?PHP Iface::setCache怎么用?PHP Iface::setCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aimeos\MShop\Context\Item\Iface
的用法示例。
在下文中一共展示了Iface::setCache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addCache
/**
* Adds the cache object to the context
*
* @param \Aimeos\MShop\Context\Item\Iface $context Context object including config
* @return \Aimeos\MShop\Context\Item\Iface Modified context object
*/
protected function addCache(\Aimeos\MShop\Context\Item\Iface $context)
{
$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard($context);
$context->setCache($cache);
return $context;
}
示例2: addCache
/**
* Adds the cache object to the context
*
* @param \Aimeos\MShop\Context\Item\Iface $context Context object including config
* @return \Aimeos\MShop\Context\Item\Iface Modified context object
*/
protected function addCache(\Aimeos\MShop\Context\Item\Iface $context)
{
$config = $context->getConfig();
switch ($config->get('flow/cache/name', 'Flow')) {
case 'None':
$config->set('client/html/basket/cache/enable', false);
return $context->setCache(\Aimeos\MW\Cache\Factory::createManager('None', array(), null));
case 'Flow':
return $context->setCache(new \Aimeos\MAdmin\Cache\Proxy\Flow($context, $this->cache));
default:
return $context->setCache(new \Aimeos\MAdmin\Cache\Proxy\Standard($context));
}
}