Ejemplo n.º 1
0
 /**
  * Delete the document from MongoDB afer the product have been saved
  *
  * @param Mage_Catalog_Model_Product $object The deleted product
  *
  * @return Smile_MongoCore_Model_Resource_Override_Catalog_Product Self reference
  */
 protected function _afterDelete(Varien_Object $object)
 {
     parent::_afterDelete($object);
     $id = null;
     if (is_numeric($object)) {
         $id = (int) $object;
     } elseif ($object instanceof Varien_Object) {
         $id = (int) $object->getId();
     }
     if (!is_null($id)) {
         $removeFilter = $this->getIdsFilter($id);
         $collection = $this->_getDocumentCollection();
         $collection->remove($removeFilter, array('justOne' => false));
     }
     return $this;
 }