/** * Purge visitor data by customer (logout) * * @param Mage_Reports_Model_Product_Index_Abstract $object * @return Mage_Reports_Model_Mysql4_Product_Index_Abstract */ public function purgeVisitorByCustomer(Mage_Reports_Model_Product_Index_Abstract $object) { if (!$object->getCustomerId()) { return $this; } $where = $this->_getWriteAdapter()->quoteInto('customer_id=?', $object->getCustomerId()); $bind = array('visitor_id' => null); $this->_getWriteAdapter()->update($this->getMainTable(), $bind, $where); return $this; }
/** * Purge visitor data by customer (logout) * * @param Mage_Reports_Model_Product_Index_Abstract $object * @return Mage_Reports_Model_Resource_Product_Index_Abstract */ public function purgeVisitorByCustomer(Mage_Reports_Model_Product_Index_Abstract $object) { /** * Do nothing if customer not logged in */ if (!$object->getCustomerId()) { return $this; } $bind = array('visitor_id' => null); $where = array('customer_id = ?' => (int) $object->getCustomerId()); $this->_getWriteAdapter()->update($this->getMainTable(), $bind, $where); return $this; }