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


PHP FrontendInterface::clean方法代码示例

本文整理汇总了PHP中Magento\Framework\Cache\FrontendInterface::clean方法的典型用法代码示例。如果您正苦于以下问题:PHP FrontendInterface::clean方法的具体用法?PHP FrontendInterface::clean怎么用?PHP FrontendInterface::clean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Framework\Cache\FrontendInterface的用法示例。


在下文中一共展示了FrontendInterface::clean方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _afterSave

 /**
  * Update a "layout update link" if relevant data is provided
  *
  * @param \Magento\Widget\Model\Layout\Update|\Magento\Framework\Model\AbstractModel $object
  * @return $this
  */
 protected function _afterSave(\Magento\Framework\Model\AbstractModel $object)
 {
     $data = $object->getData();
     if (isset($data['store_id']) && isset($data['theme_id'])) {
         $this->getConnection()->insertOnDuplicate($this->getTable('layout_link'), ['store_id' => $data['store_id'], 'theme_id' => $data['theme_id'], 'layout_update_id' => $object->getId(), 'is_temporary' => (int) $object->getIsTemporary()]);
     }
     $this->_cache->clean();
     return parent::_afterSave($object);
 }
开发者ID:tingyeeh,项目名称:magento2,代码行数:15,代码来源:Update.php

示例2: assignToStore

 /**
  * Assign theme to the stores
  *
  * @param \Magento\Framework\View\Design\ThemeInterface $theme
  * @param array $stores
  * @param string $scope
  * @return $this
  */
 public function assignToStore($theme, array $stores = [], $scope = \Magento\Store\Model\ScopeInterface::SCOPE_STORES)
 {
     $isReassigned = false;
     $this->_unassignThemeFromStores($theme->getId(), $stores, $scope, $isReassigned);
     if ($this->_storeManager->isSingleStoreMode()) {
         $this->_assignThemeToDefaultScope($theme->getId(), $isReassigned);
     } else {
         $this->_assignThemeToStores($theme->getId(), $stores, $scope, $isReassigned);
     }
     if ($isReassigned) {
         $this->_configCache->clean();
         $this->_layoutCache->clean();
     }
     $this->_eventManager->dispatch('assign_theme_to_stores_after', ['stores' => $stores, 'scope' => $scope, 'theme' => $theme]);
     return $this;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:24,代码来源:Config.php

示例3: clear

 /**
  * Deletes all items in the pool.
  *
  * @return bool
  *   True if the pool was successfully cleared. False if there was an error.
  */
 public function clear()
 {
     if (empty($this->tags)) {
         return false;
     }
     return $this->cacheFrontend->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, $this->tags);
 }
开发者ID:ecomdev,项目名称:magento-psr6-bridge,代码行数:13,代码来源:CacheItemPool.php

示例4: reinitStores

 /**
  * {@inheritdoc}
  */
 public function reinitStores()
 {
     $this->currentStoreId = null;
     $this->storeRepository->clean();
     $this->websiteRepository->clean();
     $this->groupRepository->clean();
     $this->cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, [StoreResolver::CACHE_TAG]);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:11,代码来源:StoreManager.php

示例5: clean

 /**
  * Clean cached data by specific tag
  *
  * @param array $tags
  * @return bool
  */
 public function clean($tags = array())
 {
     if ($tags) {
         $result = $this->_frontend->clean(\Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, (array) $tags);
     } else {
         /** @deprecated special case of cleaning by empty tags is deprecated after 2.0.0.0-dev42 */
         $result = false;
         /** @var $cacheFrontend \Magento\Framework\Cache\FrontendInterface */
         foreach ($this->_frontendPool as $cacheFrontend) {
             if ($cacheFrontend->clean()) {
                 $result = true;
             }
         }
     }
     return $result;
 }
开发者ID:,项目名称:,代码行数:22,代码来源:

示例6: initialize

 /**
  * Initialize interception config
  *
  * @param array $classDefinitions
  * @return void
  */
 public function initialize($classDefinitions = [])
 {
     $this->_cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, [$this->_cacheId]);
     $config = [];
     foreach ($this->_scopeList->getAllScopes() as $scope) {
         $config = array_replace_recursive($config, $this->_reader->read($scope));
     }
     unset($config['preferences']);
     foreach ($config as $typeName => $typeConfig) {
         if (!empty($typeConfig['plugins'])) {
             $this->_intercepted[ltrim($typeName, '\\')] = true;
         }
     }
     foreach ($config as $typeName => $typeConfig) {
         $this->hasPlugins($typeName);
     }
     foreach ($classDefinitions as $class) {
         $this->hasPlugins($class);
     }
     $this->_cache->save(serialize($this->_intercepted), $this->_cacheId);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:27,代码来源:Config.php

示例7: _saveAdvanced

 /**
  * Advanced save procedure
  *
  * @return void
  */
 protected function _saveAdvanced()
 {
     $this->_cache->clean();
 }
开发者ID:opexsw,项目名称:magento2,代码行数:9,代码来源:Save.php

示例8:

 function it_does_not_clear_cache_if_no_tags_specified_to_prevent_full_cache_flush()
 {
     $this->cacheFrontend->clean(Argument::any(), Argument::any())->shouldNotBeCalled();
     $this->beConstructedWith($this->cacheItemFactory, $this->cacheFrontend, 'prefix_', []);
     $this->clear()->shouldReturn(false);
 }
开发者ID:ecomdev,项目名称:magento-psr6-bridge,代码行数:6,代码来源:CacheItemPoolSpec.php

示例9: resetDdlCache

 /**
  * Reset cached DDL data from cache
  * if table name is null - reset all cached DDL data
  *
  * @param string $tableName
  * @param string $schemaName OPTIONAL
  * @return $this
  */
 public function resetDdlCache($tableName = null, $schemaName = null)
 {
     if (!$this->_isDdlCacheAllowed) {
         return $this;
     }
     if ($tableName === null) {
         $this->_ddlCache = array();
         if ($this->_cacheAdapter) {
             $this->_cacheAdapter->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, array(self::DDL_CACHE_TAG));
         }
     } else {
         $cacheKey = $this->_getTableName($tableName, $schemaName);
         $ddlTypes = array(self::DDL_DESCRIBE, self::DDL_CREATE, self::DDL_INDEX, self::DDL_FOREIGN_KEY);
         foreach ($ddlTypes as $ddlType) {
             unset($this->_ddlCache[$ddlType][$cacheKey]);
         }
         if ($this->_cacheAdapter) {
             foreach ($ddlTypes as $ddlType) {
                 $cacheId = $this->_getCacheId($cacheKey, $ddlType);
                 $this->_cacheAdapter->remove($cacheId);
             }
         }
     }
     return $this;
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:33,代码来源:Mysql.php

示例10: clean

 /**
  * Clear cache of all scopes
  *
  * @return void
  */
 public function clean()
 {
     $this->_scopes = [];
     $this->_cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, [self::CACHE_TAG]);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:10,代码来源:ScopePool.php

示例11: _afterSave

 /**
  * Process role after saving
  *
  * @param \Magento\Framework\Model\AbstractModel $role
  * @return $this
  */
 protected function _afterSave(\Magento\Framework\Model\AbstractModel $role)
 {
     $this->_updateRoleUsersAcl($role);
     $this->_cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, array(\Magento\Backend\Block\Menu::CACHE_TAGS));
     return $this;
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:12,代码来源:Role.php


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