/** * @param \Magento\Framework\Mview\Config\Reader $reader * @param \Magento\Framework\Config\CacheInterface $cache * @param \Magento\Framework\Mview\View\State\CollectionInterface $stateCollection * @param string $cacheId */ public function __construct(\Magento\Framework\Mview\Config\Reader $reader, \Magento\Framework\Config\CacheInterface $cache, \Magento\Framework\Mview\View\State\CollectionInterface $stateCollection, $cacheId = 'mview_config') { $this->stateCollection = $stateCollection; $isCacheExists = $cache->test($cacheId); parent::__construct($reader, $cache, $cacheId); if (!$isCacheExists) { $this->deleteNonexistentStates(); } }
/** * @param \Magento\Indexer\Model\Config\Reader $reader * @param \Magento\Framework\Config\CacheInterface $cache * @param \Magento\Indexer\Model\Resource\Indexer\State\Collection $stateCollection * @param string $cacheId */ public function __construct(\Magento\Indexer\Model\Config\Reader $reader, \Magento\Framework\Config\CacheInterface $cache, \Magento\Indexer\Model\Resource\Indexer\State\Collection $stateCollection, $cacheId = 'indexer_config') { $this->stateCollection = $stateCollection; $isCacheExists = $cache->test($cacheId); parent::__construct($reader, $cache, $cacheId); if (!$isCacheExists) { $this->deleteNonexistentStates(); } }
/** * Check whether ACL object is in cache * * @return bool */ public function has() { return null !== $this->_acl || $this->_cache->test($this->_cacheKey); }