2011-08-11 18 views
0

如問題中所述,當有人進入管理面板併爲Catalog Search Index選擇reindex數據時會觸發哪個事件?Magento事件(在索引上調用哪個事件?)

我試着在我的命令shell上運行grep,我似乎無法讓它工作(獲取事件列表)。我試過看事件列表,找不到正確的。

我會傾向於認爲,該事件catalogindex_plain_reindex_after將被解僱,但我已經嘗試這樣做,是不是這樣的......

任何幫助將不勝感激!

+0

試圖記錄所有事件? –

+0

我對Magento有點新鮮。我怎麼能這樣做? –

+1

[http://magebase.com/magento-tutorials/quick-tip-finding-events-or-where-has-cataloginventory_stock_item_save_before-gone/](http://magebase.com/magento-tutorials/quick-tip-發現事件或在哪裏有 - cataloginventory_stock_item_save_before-gone /) –

回答

1

如果你不能找到任何特定事件調度,你總是可以得到控制的下列事件:

<controller_action_postdispatch_adminhtml_index_process_massReindex>...</controller_action_postdispatch_adminhtml_index_process_massReindex> 

,並在觀察者就可以得到控制PARAMS爲:

$observer->getEvent()->getData('controller_action')->getRequest()->getParam('some_id_or_variable'); 

其中「 some_id_or_variable'是你想從請求參數中獲得的值。

+0

如果通過其他模型直接執行此功能,您將不會收到此事件 –

+1

正確我同意但是具體詢問「當某人進入管理面板併爲目錄搜索索引選擇重新索引數據時觸發了哪個事件」......但我同意這不是一個很好的做法。 – Nasaralla