30 private $cacheManager;
43 \
Magento\Framework\Event\ManagerInterface $eventManager
46 $this->_eventManager = $eventManager;
67 $this->indexBuilder->reindexFull();
68 $this->_eventManager->dispatch(
'clean_cache_by_tags', [
'object' => $this]);
98 throw new \Magento\Framework\Exception\LocalizedException(
99 __(
'Could not rebuild index for empty products array')
123 throw new \Magento\Framework\Exception\LocalizedException(
124 __(
'We can\'t rebuild the index for an undefined product.')
144 private function getCacheManager()
146 if ($this->cacheManager ===
null) {
151 return $this->cacheManager;
163 return \Magento\Framework\App\ObjectManager::getInstance()->get(CacheContext::class);
__construct(IndexBuilder $indexBuilder, \Magento\Framework\Event\ManagerInterface $eventManager)