当前位置: 首页>>代码示例>>PHP>>正文


PHP CacheInterface::clean方法代码示例

本文整理汇总了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();
 }
开发者ID:tkotosz,项目名称:behat-magento2-init,代码行数:15,代码来源:MagentoConfigManager.php

示例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;
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:13,代码来源:AttributeCache.php

示例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;
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:15,代码来源:Config.php

示例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/*/');
 }
开发者ID:nblair,项目名称:magescotch,代码行数:28,代码来源:Save.php

示例5: cleanModelCache

 /**
  * Remove model object related cache
  *
  * @return $this
  */
 public function cleanModelCache()
 {
     $tags = $this->getCacheTags();
     if ($tags !== false) {
         $this->_cacheManager->clean($tags);
     }
     return $this;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:13,代码来源:AbstractModel.php

示例6: _afterMove

 /**
  * Move tree after
  *
  * @return $this
  */
 protected function _afterMove()
 {
     $this->_cache->clean([\Magento\Catalog\Model\Category::CACHE_TAG]);
     return $this;
 }
开发者ID:BlackIkeEagle,项目名称:magento2-continuousphp,代码行数:10,代码来源:Tree.php

示例7: renewSecretUrls

 /**
  * Refresh admin menu cache etc.
  *
  * @return void
  */
 public function renewSecretUrls()
 {
     $this->_cache->clean([\Magento\Backend\Block\Menu::CACHE_TAGS]);
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:9,代码来源:Url.php

示例8: cleanCache

 /**
  * Clean cache
  *
  * @return $this
  */
 public function cleanCache()
 {
     $this->cache->clean([\Magento\Eav\Model\Cache\Type::CACHE_TAG]);
     return $this;
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:10,代码来源:EavSetup.php

示例9: cleanCache

 /**
  * Clean cache
  *
  * @return $this
  */
 public function cleanCache()
 {
     $this->_cache->clean(array(\Magento\Eav\Model\Cache\Type::CACHE_TAG));
     return $this;
 }
开发者ID:aiesh,项目名称:magento2,代码行数:10,代码来源:Setup.php

示例10: _refreshConfig

 /**
  * Ensure changes in the configuration, if any, take effect
  *
  * @return void
  */
 protected function _refreshConfig()
 {
     $this->_cache->clean();
     $this->_config->reinit();
 }
开发者ID:aiesh,项目名称:magento2,代码行数:10,代码来源:Installer.php

示例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);
 }
开发者ID:smile-sa,项目名称:elasticsuite,代码行数:13,代码来源:Cache.php

示例12: cleanDownCachedRates

 public function cleanDownCachedRates()
 {
     $this->cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, [self::CACHE_TAG]);
 }
开发者ID:shipperhq,项目名称:module-shipper,代码行数:4,代码来源:CarrierCache.php


注:本文中的Magento\Framework\App\CacheInterface::clean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。