![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-catalog/Model/Indexer/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Catalog\Model\Indexer; use Magento\Store\Model\ScopeInterface; /** * @api * @since 100.0.2 */ abstract class AbstractFlatState { /** * Indexer ID in configuration */ const INDEXER_ID = ''; /** * Flat Is Enabled Config XML Path */ const INDEXER_ENABLED_XML_PATH = ''; /** * @var \Magento\Framework\App\Config\ScopeConfigInterface */ protected $scopeConfig; /** * @var bool */ protected $isAvailable; /** * @var \Magento\Framework\Indexer\IndexerRegistry */ protected $indexerRegistry; /** * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry * @param bool $isAvailable */ public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry, $isAvailable = false ) { $this->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(); } }