scopeConfig = $scopeConfig; $this->indexerRegistry = $indexerRegistry; $this->isAvailable = $isAvailable; } /** * Check if Flat Index is enabled * * @return bool */ public function isFlatEnabled() { return $this->scopeConfig->isSetFlag(static::INDEXER_ENABLED_XML_PATH, ScopeInterface::SCOPE_STORE); } /** * Check if Flat Index is available for use * * @return bool */ public function isAvailable() { return $this->isAvailable && $this->isFlatEnabled() && $this->indexerRegistry->get(static::INDEXER_ID)->isValid(); } }