@@ -208,22 +208,20 @@ protected function _registerEvent(Mage_Index_Model_Event $event)
208208 */
209209 protected function _registerCatalogCategoryEvent (Mage_Index_Model_Event $ event )
210210 {
211- switch ($ event ->getType ()) {
212- case Mage_Index_Model_Event::TYPE_SAVE :
213- /** @var Mage_Catalog_Model_Category $category */
214- $ category = $ event ->getDataObject ();
215- $ productIds = $ category ->getAffectedProductIds ();
216- if ($ productIds ) {
217- $ event ->addNewData ('catalogsearch_category_update_product_ids ' , $ productIds );
218- $ event ->addNewData ('catalogsearch_category_update_category_ids ' , [$ category ->getId ()]);
219- } else {
220- $ movedCategoryId = $ category ->getMovedCategoryId ();
221- if ($ movedCategoryId ) {
222- $ event ->addNewData ('catalogsearch_category_update_product_ids ' , []);
223- $ event ->addNewData ('catalogsearch_category_update_category_ids ' , [$ movedCategoryId ]);
224- }
211+ if ($ event ->getType () === Mage_Index_Model_Event::TYPE_SAVE ) {
212+ /** @var Mage_Catalog_Model_Category $category */
213+ $ category = $ event ->getDataObject ();
214+ $ productIds = $ category ->getAffectedProductIds ();
215+ if ($ productIds ) {
216+ $ event ->addNewData ('catalogsearch_category_update_product_ids ' , $ productIds );
217+ $ event ->addNewData ('catalogsearch_category_update_category_ids ' , [$ category ->getId ()]);
218+ } else {
219+ $ movedCategoryId = $ category ->getMovedCategoryId ();
220+ if ($ movedCategoryId ) {
221+ $ event ->addNewData ('catalogsearch_category_update_product_ids ' , []);
222+ $ event ->addNewData ('catalogsearch_category_update_category_ids ' , [$ movedCategoryId ]);
225223 }
226- break ;
224+ }
227225 }
228226
229227 return $ this ;
0 commit comments