Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
CacheInvalidate Class Reference

Public Member Functions

 __construct (\Magento\Framework\App\Cache\TypeListInterface $typeList, \Magento\Swatches\Helper\Data $swatchHelper)
 
 afterSave (\Magento\Catalog\Model\ResourceModel\Eav\Attribute $subject, \Magento\Catalog\Model\ResourceModel\Eav\Attribute $result)
 

Detailed Description

Definition at line 11 of file CacheInvalidate.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\App\Cache\TypeListInterface  $typeList,
\Magento\Swatches\Helper\Data  $swatchHelper 
)
Parameters
\Magento\Framework\App\Cache\TypeListInterface$typeList
\Magento\Swatches\Helper\Data$swatchHelper

Definition at line 27 of file CacheInvalidate.php.

30  {
31  $this->typeList = $typeList;
32  $this->swatchHelper = $swatchHelper;
33  }

Member Function Documentation

◆ afterSave()

Parameters
\Magento\Catalog\Model\ResourceModel\Eav\Attribute$subject
\Magento\Catalog\Model\ResourceModel\Eav\Attribute$result
Returns
\Magento\Catalog\Model\ResourceModel\Eav\Attribute

Definition at line 40 of file CacheInvalidate.php.

43  {
44  if ($this->swatchHelper->isSwatchAttribute($subject)) {
45  $this->typeList->invalidate(Block::TYPE_IDENTIFIER);
46  $this->typeList->invalidate(Collection::TYPE_IDENTIFIER);
47  }
48  return $result;
49  }

The documentation for this class was generated from the following file: