/**
  * 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;
 }
예제 #2
0
파일: Abstract.php 프로젝트: relue/magento2
 /**
  * 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;
 }