![]() 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/mageworx/module-seo-ai/Helper/ |
<?php namespace MageWorx\SeoAI\Helper; use Magento\Framework\App\Helper\AbstractHelper; use Magento\Store\Model\ScopeInterface; class Config extends AbstractHelper { /** * @param string $path * @param int|null $storeId * @return string */ public function getValue(string $path, ?int $storeId = null): string { return (string)$this->scopeConfig->getValue($path, ScopeInterface::SCOPE_STORE, $storeId); } /** * Check is generate enabled * * @param int|null $storeId * @return bool */ public function isEnabled(?int $storeId = null): bool { return $this->scopeConfig->isSetFlag( 'mageworx_seo/mageworx_seoai/is_enabled', ScopeInterface::SCOPE_STORE, $storeId ); } /** * Check is generate enabled for category * * @param int|null $storeId * @return bool */ public function isEnabledForCategory(?int $storeId = null): bool { $enabledOn = (string)$this->scopeConfig->getValue( 'mageworx_seo/mageworx_seoai/enabled_on', ScopeInterface::SCOPE_STORE, $storeId ); $enabledOnArray = explode(',', $enabledOn); return in_array('category', $enabledOnArray); } /** * Check is generate enabled for product * * @param int|null $storeId * @return bool */ public function isEnabledForProduct(?int $storeId = null): bool { $enabledOn = (string)$this->scopeConfig->getValue( 'mageworx_seo/mageworx_seoai/enabled_on', ScopeInterface::SCOPE_STORE, $storeId ); $enabledOnArray = explode(',', $enabledOn); return in_array('product', $enabledOnArray); } /** * Is Generation available: * - if api key is not set the generation process will be unavailable * * @param int|null $storeId * @return bool */ public function isAvailable(?int $storeId = null): bool { return $this->scopeConfig->isSetFlag( 'mageworx_openai/main_settings/api_key', ScopeInterface::SCOPE_STORE, $storeId ); } }