本文整理汇总了PHP中Mage_Index_Model_Process::reindexAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Index_Model_Process::reindexAll方法的具体用法?PHP Mage_Index_Model_Process::reindexAll怎么用?PHP Mage_Index_Model_Process::reindexAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Index_Model_Process
的用法示例。
在下文中一共展示了Mage_Index_Model_Process::reindexAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reindexAll
/**
* Reindex all data what this process responsible is
*
*/
public function reindexAll($force = false)
{
if (!$force && Mage::getStoreConfig('asyncindex/general/full_reindex')) {
$this->changeStatus(Mirasvit_AsyncIndex_Model_Process::STATUS_WAIT);
} else {
parent::reindexAll();
}
}
示例2: reindexAll
/**
* @return $this
*/
public function reindexAll()
{
if ($this->isLocked()) {
Mage::throwException(Mage::helper('schumacherfm_fastindexer')->__('%s Index process is working now. Please try run this process later or remove the lock if no indexer is running!', $this->getIndexer()->getName()));
}
Mage::dispatchEvent(self::BEFORE_REINDEX_PROCESS_EVENT . $this->getIndexerCode());
return parent::reindexAll();
}
示例3: reindexAll
/**
* Reindex all data
* if process status is "pending" than we process only the event queue, else
* if process status is "index_required" we are reindexing everything
*
*/
public function reindexAll()
{
if ($this->getMode() !== self::MODE_QUEUED) {
return parent::reindexAll();
}
if ($this->isLocked()) {
Mage::throwException(Mage::helper('index')->__('%s Index process is working now. Please try run this process later.', $this->getIndexer()->getName()));
}
$processStatus = $this->getStatus();
$this->_getResource()->startProcess($this);
$this->lock();
$processedSomething = TRUE;
try {
$eventsCollection = $this->getUnprocessedEventsCollection();
/** @var $eventResource Mage_Index_Model_Resource_Event */
$eventResource = Mage::getResourceSingleton('index/event');
if ($processStatus == self::STATUS_PENDING || $this->getForcePartialReindex()) {
if ($eventsCollection->count() > 0) {
$this->_getResource()->beginTransaction();
try {
$this->_processEventsCollection($eventsCollection, false);
$this->_getResource()->commit();
} catch (Exception $e) {
$this->_getResource()->rollBack();
throw $e;
}
} else {
$processedSomething = FALSE;
}
} else {
//Update existing events since we'll do reindexAll
$eventResource->updateProcessEvents($this);
$this->getIndexer()->reindexAll();
}
$this->unlock();
$this->_getResource()->endProcess($this);
} catch (Exception $e) {
$this->unlock();
$this->_getResource()->failProcess($this);
throw $e;
}
if ($processedSomething) {
//we want to dispatch this event only if we actually processed sth
Mage::dispatchEvent('after_reindex_process_' . $this->getIndexerCode());
}
}