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

public getObject ( Mage_Catalog_Model_Category $category )
$category Mage_Catalog_Model_Category
Пример #1
0
 public function rebuildStoreCategoryIndexPage($storeId, $collectionDefault, $page, $pageSize, $emulationInfo = null)
 {
     if ($this->config->isEnabledBackend($storeId) === false) {
         $this->logger->log('INDEXING IS DISABLED FOR ' . $this->logger->getStoreName($storeId));
         return;
     }
     $emulationInfoPage = null;
     if ($emulationInfo === null) {
         $emulationInfoPage = $this->startEmulation($storeId);
     }
     $collection = clone $collectionDefault;
     $collection->setCurPage($page)->setPageSize($pageSize);
     $collection->load();
     $index_name = $this->category_helper->getIndexName($storeId);
     $indexData = array();
     /** @var $category Mage_Catalog_Model_Category */
     foreach ($collection as $category) {
         if (!$this->category_helper->isCategoryActive($category->getId(), $storeId)) {
             continue;
         }
         $category->setStoreId($storeId);
         $category_obj = $this->category_helper->getObject($category);
         if ($category_obj['product_count'] > 0) {
             array_push($indexData, $category_obj);
         }
     }
     if (count($indexData) > 0) {
         $this->algolia_helper->addObjects($indexData, $index_name);
     }
     unset($indexData);
     $collection->walk('clearInstance');
     $collection->clear();
     unset($collection);
     if ($emulationInfo === null) {
         $this->stopEmulation($emulationInfoPage);
     }
 }