scopeConfig = $scopeConfig; $this->path = $path; $this->scopeType = $scopeType; $this->scopeCode = $scopeCode; $this->engines = $engines; $this->logger = $logger; } /** * Returns Current Search Engine * * It returns string identifier of Search Engine that is currently chosen in configuration * * @return string * @since 100.1.0 */ public function getCurrentSearchEngine() { $engine = $this->scopeConfig->getValue( $this->path, $this->scopeType, $this->scopeCode ); if (in_array($engine, $this->engines)) { return $engine; } else { $this->logger->error( $engine . ' search engine doesn\'t exists. Falling back to ' . self::CATALOG_SEARCH_MYSQL_ENGINE ); return self::CATALOG_SEARCH_MYSQL_ENGINE; } } }