本文整理汇总了PHP中Magento\Framework\App\CacheInterface::clean方法的典型用法代码示例。如果您正苦于以下问题:PHP CacheInterface::clean方法的具体用法?PHP CacheInterface::clean怎么用?PHP CacheInterface::clean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\App\CacheInterface
的用法示例。
在下文中一共展示了CacheInterface::clean方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: changeConfigs
/**
* @param array $configs
*
* @return void
*/
public function changeConfigs(array $configs)
{
foreach ($configs as $config) {
$config = array_merge($this->defaultConfig, $config);
if ($this->isValidConfig($config)) {
$this->changeConfig($config['path'], $config['value'], $config['scope_type'], $config['scope_code']);
}
}
$this->cache->clean();
}
示例2: clear
/**
* Clear attributes cache
*
* @return bool
*/
public function clear()
{
unset($this->attributeInstances);
if ($this->isAttributeCacheEnabled()) {
$this->cache->clean([\Magento\Eav\Model\Cache\Type::CACHE_TAG, \Magento\Eav\Model\Entity\Attribute::CACHE_TAG]);
}
return true;
}
示例3: clear
/**
* Reset object state
*
* @return $this
*/
public function clear()
{
$this->_entityTypeData = null;
$this->_attributeData = null;
$this->_objects = null;
$this->_references = null;
$this->_attributeCodes = null;
$this->_cache->clean([\Magento\Eav\Model\Cache\Type::CACHE_TAG, \Magento\Eav\Model\Entity\Attribute::CACHE_TAG]);
return $this;
}
示例4: executeInternal
/**
* Process saving new encryption key
*
* @return void
*/
public function executeInternal()
{
try {
$key = null;
if (0 == $this->getRequest()->getPost('generate_random')) {
$key = $this->getRequest()->getPost('crypt_key');
if (empty($key)) {
throw new \Exception(__('Please enter an encryption key.'));
}
$this->encryptor->validateKey($key);
}
$newKey = $this->change->changeEncryptionKey($key);
$this->messageManager->addSuccessMessage(__('The encryption key has been changed.'));
if (!$key) {
$this->messageManager->addNoticeMessage(__('This is your new encryption key: <span style="font-family:monospace;">%1</span>. ' . 'Be sure to write it down and take good care of it!', $newKey));
}
$this->cache->clean();
} catch (\Exception $e) {
$this->messageManager->addErrorMessage($e->getMessage());
$this->_session->setFormData(['crypt_key' => $key]);
}
$this->_redirect('adminhtml/*/');
}
示例5: cleanModelCache
/**
* Remove model object related cache
*
* @return $this
*/
public function cleanModelCache()
{
$tags = $this->getCacheTags();
if ($tags !== false) {
$this->_cacheManager->clean($tags);
}
return $this;
}
示例6: _afterMove
/**
* Move tree after
*
* @return $this
*/
protected function _afterMove()
{
$this->_cache->clean([\Magento\Catalog\Model\Category::CACHE_TAG]);
return $this;
}
示例7: renewSecretUrls
/**
* Refresh admin menu cache etc.
*
* @return void
*/
public function renewSecretUrls()
{
$this->_cache->clean([\Magento\Backend\Block\Menu::CACHE_TAGS]);
}
示例8: cleanCache
/**
* Clean cache
*
* @return $this
*/
public function cleanCache()
{
$this->cache->clean([\Magento\Eav\Model\Cache\Type::CACHE_TAG]);
return $this;
}
示例9: cleanCache
/**
* Clean cache
*
* @return $this
*/
public function cleanCache()
{
$this->_cache->clean(array(\Magento\Eav\Model\Cache\Type::CACHE_TAG));
return $this;
}
示例10: _refreshConfig
/**
* Ensure changes in the configuration, if any, take effect
*
* @return void
*/
protected function _refreshConfig()
{
$this->_cache->clean();
$this->_config->reinit();
}
示例11: cleanIndexCache
/**
* Clean the cache by index identifier and store.
*
* @param string $indexIdentifier Index identifier.
* @param string $storeId Store id.
*
* @return void
*/
public function cleanIndexCache($indexIdentifier, $storeId)
{
$cacheTags = $this->getCacheTags($indexIdentifier, $storeId);
$this->cache->clean($cacheTags);
}
示例12: cleanDownCachedRates
public function cleanDownCachedRates()
{
$this->cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, [self::CACHE_TAG]);
}