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


PHP TypeListInterface::invalidate方法代码示例

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


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

示例1: execute

 /**
  * Invalidate full page and block cache
  *
  * @param \Magento\Framework\Event\Observer $observer
  * @return void
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function execute(\Magento\Framework\Event\Observer $observer)
 {
     if ($this->_config->isEnabled()) {
         $this->_typeList->invalidate(\Magento\PageCache\Model\Cache\Type::TYPE_IDENTIFIER);
     }
     $this->_typeList->invalidate(\Magento\Framework\App\Cache\Type\Block::TYPE_IDENTIFIER);
 }
开发者ID:magefan,项目名称:module-blog,代码行数:14,代码来源:InvalidateCache.php

示例2: execute

 /**
  * Invalidate full page cache
  *
  * @return void
  */
 public function execute()
 {
     if ($this->_config->isEnabled()) {
         $this->_typeList->invalidate('full_page');
     }
     return $this;
 }
开发者ID:zhangjiachao,项目名称:magento2,代码行数:12,代码来源:InvalidateCache.php

示例3: afterExecute

 /**
  * @param AbstractAction $subject
  * @param AbstractAction $result
  * @return AbstractAction
  *
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function afterExecute(AbstractAction $subject, AbstractAction $result)
 {
     if ($this->config->isEnabled()) {
         $this->typeList->invalidate('full_page');
     }
     return $result;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:14,代码来源:Execute.php

示例4: afterAfterSave

 /**
  * Invalidate WebApi cache if needed.
  * 
  * @param \Magento\Framework\App\Config\Value $subject
  * @param \Magento\Framework\App\Config\Value $result
  * @return \Magento\Framework\App\Config\Value
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function afterAfterSave(\Magento\Framework\App\Config\Value $subject, \Magento\Framework\App\Config\Value $result)
 {
     if ($subject->getPath() == \Magento\WebapiSecurity\Model\Plugin\AnonymousResourceSecurity::XML_ALLOW_INSECURE && $subject->isValueChanged()) {
         $this->cacheTypeList->invalidate(\Magento\Framework\App\Cache\Type\Webapi::TYPE_IDENTIFIER);
     }
     return $result;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:15,代码来源:CacheInvalidator.php

示例5: aroundSave

 /**
  * @param \Magento\Catalog\Model\Resource\Attribute $subject
  * @param callable $proceed
  * @param \Magento\Framework\Model\AbstractModel $attribute
  * @return mixed
  *
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function aroundSave(\Magento\Catalog\Model\Resource\Attribute $subject, \Closure $proceed, \Magento\Framework\Model\AbstractModel $attribute)
 {
     $result = $proceed($attribute);
     if ($this->config->isEnabled()) {
         $this->typeList->invalidate('full_page');
     }
     return $result;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:16,代码来源:Save.php

示例6: afterSave

 /**
  * Set status 'invalidate' for blocks and other output caches
  *
  * @return $this
  */
 public function afterSave()
 {
     $types = array_keys($this->_scopeConfig->getValue(self::XML_PATH_INVALID_CACHES, \Magento\Store\Model\ScopeInterface::SCOPE_STORE));
     if ($this->isValueChanged()) {
         $this->_cacheTypeList->invalidate($types);
     }
     return $this;
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:13,代码来源:Translate.php

示例7: afterSave

 /**
  * @param \Magento\Catalog\Model\ResourceModel\Eav\Attribute $subject
  * @param \Magento\Catalog\Model\ResourceModel\Eav\Attribute $result
  * @return \Magento\Catalog\Model\ResourceModel\Eav\Attribute
  */
 public function afterSave(\Magento\Catalog\Model\ResourceModel\Eav\Attribute $subject, \Magento\Catalog\Model\ResourceModel\Eav\Attribute $result)
 {
     if ($this->swatchHelper->isSwatchAttribute($subject)) {
         $this->typeList->invalidate(Block::TYPE_IDENTIFIER);
         $this->typeList->invalidate(Collection::TYPE_IDENTIFIER);
     }
     return $result;
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:13,代码来源:CacheInvalidate.php

示例8: execute

 /**
  * Invalidate full page cache if content is changed
  *
  * @param \Magento\Framework\Event\Observer $observer
  * @return void
  */
 public function execute(\Magento\Framework\Event\Observer $observer)
 {
     if ($this->config->isEnabled()) {
         $object = $observer->getEvent()->getObject();
         if ($object instanceof \Magento\Framework\Object\IdentityInterface) {
             if ($object->getIdentities()) {
                 $this->typeList->invalidate('full_page');
             }
         }
     }
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:17,代码来源:InvalidateCacheIfChanged.php

示例9: _invalidateCache

 /**
  * Invalidate related cache types
  *
  * @return $this
  */
 protected function _invalidateCache()
 {
     if (count($this->_relatedCacheTypes)) {
         $this->_cacheTypeList->invalidate($this->_relatedCacheTypes);
     }
     return $this;
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:12,代码来源:Instance.php

示例10: afterSave

 /**
  * {@inheritdoc}
  *
  * {@inheritdoc}. In addition, it sets status 'invalidate' for config caches
  *
  * @return $this
  */
 public function afterSave()
 {
     if ($this->isValueChanged()) {
         $this->cacheTypeList->invalidate(\Magento\Framework\App\Cache\Type\Config::TYPE_IDENTIFIER);
     }
     return parent::afterSave();
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:14,代码来源:Value.php

示例11: processAjaxPost

 /**
  * Parse and save edited translation
  *
  * @param array $translateParams
  * @return array
  */
 public function processAjaxPost(array $translateParams)
 {
     if (!$this->_translateInline->isAllowed()) {
         return ['inline' => 'not allowed'];
     }
     $this->_appCache->invalidate(\Magento\Framework\App\Cache\Type\Translate::TYPE_IDENTIFIER);
     $this->_validateTranslationParams($translateParams);
     $this->_filterTranslationParams($translateParams, ['custom']);
     /** @var $validStoreId int */
     $validStoreId = $this->_storeManager->getStore()->getId();
     /** @var $resource \Magento\Translation\Model\ResourceModel\StringUtils */
     $resource = $this->_resourceFactory->create();
     foreach ($translateParams as $param) {
         if ($this->_appState->getAreaCode() == \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) {
             $storeId = 0;
         } else {
             if (empty($param['perstore'])) {
                 $resource->deleteTranslate($param['original'], null, false);
                 $storeId = 0;
             } else {
                 $storeId = $validStoreId;
             }
         }
         $resource->saveTranslate($param['original'], $param['custom'], null, $storeId);
     }
     return $this->getCacheManger()->updateAndGetTranslations();
 }
开发者ID:BlackIkeEagle,项目名称:magento2-continuousphp,代码行数:33,代码来源:Parser.php

示例12: clearCache

 /**
  * Clear translate cache
  *
  * @return $this
  */
 protected function clearCache()
 {
     // clear cache for frontend
     foreach ($this->_cacheTypes as $cacheType) {
         $this->_cacheTypeList->invalidate($cacheType);
     }
     return $this;
 }
开发者ID:septa-setiawan,项目名称:magento2,代码行数:13,代码来源:Currencysymbol.php

示例13: invalidateCache

 /**
  * Invalidate Cache
  *
  * @return $this
  */
 public function invalidateCache()
 {
     if ($cacheTypes = $this->_cacheConfig->getTypes()) {
         $cacheTypesList = array_keys($cacheTypes);
         $this->_cacheTypeList->invalidate($cacheTypesList);
     }
     return $this;
 }
开发者ID:nja78,项目名称:magento2,代码行数:13,代码来源:Data.php

示例14: execute

 /**
  * Invalidate full page cache
  *
  * @param \Magento\Framework\Event\Observer $observer
  * @return void
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function execute(\Magento\Framework\Event\Observer $observer)
 {
     if ($this->_config->isEnabled()) {
         $this->_typeList->invalidate('full_page');
     }
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:13,代码来源:InvalidateCache.php

示例15: afterSave

 /**
  * Invalidate cache type, when value was changed
  *
  * @return void
  */
 public function afterSave()
 {
     if ($this->isValueChanged()) {
         $this->_cacheTypeList->invalidate(\Magento\Framework\View\Element\AbstractBlock::CACHE_GROUP);
     }
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:11,代码来源:Links.php


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