當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。