Exemplo n.º 1
0
 public function executeReindex($code)
 {
     /** @var $process Mage_Index_Model_Process */
     $process = $this->indexer->getProcessByCode($code);
     if ($process === false || $process->getStatus() == Mage_Index_Model_Process::STATUS_RUNNING) {
         return false;
     }
     $process->reindexEverything();
     return true;
 }
Exemplo n.º 2
0
 public function reindex($code)
 {
     /** @var $process Mage_Index_Model_Process */
     $process = $this->indexer->getProcessByCode($code);
     if ($process === false) {
         return false;
     }
     /** @var $eventsCollection Mage_Index_Model_Resource_Event_Collection */
     $eventsCollection = Mage::getResourceModel('index/event_collection')->addProcessFilter($process, Mage_Index_Model_Process::EVENT_STATUS_NEW);
     if ($eventsCollection->getSize() == 0) {
         return false;
     }
     $process->reindexEverything();
     return true;
 }