I am building a custom indexer and quick search based on a mysql table with fulltext indices and having some difficulties in understanding the Mage_Index_Model_Event::TYPE_DELETE
in conjunction with TYPE_MASS_ACTION
.
The Indexer is build very similar to Mage_Catalog_Model_Product_Indexer_Flat
.
A single delete event is working just fine, the ID got passed with the data object and I can get it with getId()
to proceed the deletion. But when I go to the Backend Catalog -> Manage Products
List and mark a few products (via checkbox) for deletion and select the delete action, just one product ID out of the selected set will get deleted, the others remain in my index (via Mage_Index_Model_Event::TYPE_DELETE
). I supposed that the deletion of multiple products would be of TYPE_MASS_ACTION
, just as it is for status change of products, but it seems not.
What event type gets triggered with multiple products deletion? Even though I would expect to get these to be deleted product IDs with $product = $event->getDataObject();
and $product->getProductIds()
. Or is there another way to solve this?
If been digging in Catalog/Model/Product/Indexer/Flat.php, the models and resources and can not find out how it is done.
Been sitting over this a few hours now, I might oversee it. Maybe somebody could shed some light on that question.
Any help and hints are appreciated!
catalog_product_entity.entity_id
field withON DELETE CASCADE
. This way you don't have to worry about the delete event or the multiple delete event. Everything will cascade nicely.