Algolia_Algoliasearch_Helper_Config::isEnabledBackend PHP Метод

isEnabledBackend() публичный Метод

public isEnabledBackend ( $storeId = null )
    public function isEnabledBackend($storeId = null)
    {
        return Mage::getStoreConfigFlag(self::ENABLE_BACKEND, $storeId);
    }

Usage Example

Пример #1
0
 /**
  * Only used when reindexing everything. Otherwise Model/Indexer/Algolia will take care of the rest.
  */
 public function rebuildIndex($storeId = null, $productIds = null)
 {
     if ($this->config->isEnabledBackend(Mage::app()->getStore()->getId()) === false) {
         return parent::rebuildIndex($storeId, $productIds);
     }
     if (!$this->config->getApplicationID() || !$this->config->getAPIKey() || !$this->config->getSearchOnlyAPIKey()) {
         /** @var Mage_Adminhtml_Model_Session $session */
         $session = Mage::getSingleton('adminhtml/session');
         $session->addError('Algolia reindexing failed: You need to configure your Algolia credentials in System > Configuration > Algolia Search.');
         return null;
     }
     /* Avoid Indexing twice */
     if (is_array($productIds) && $productIds > 0) {
         return $this;
     }
     $this->engine->rebuildProducts($storeId);
     return $this;
 }
All Usage Examples Of Algolia_Algoliasearch_Helper_Config::isEnabledBackend