Mage_Log_Model_Mysql4_Customer Class Reference

List of all members.

Public Member Functions

 __construct ()
 load ($object, $customerId)

Protected Attributes

 $_visitorTable
 $_visitorInfoTable
 $_customerTable
 $_urlInfoTable
 $_urlTable
 $_quoteTable
 $_read
 $_write


Detailed Description

Definition at line 35 of file Customer.php.


Constructor & Destructor Documentation

__construct (  ) 

Definition at line 93 of file Customer.php.

00094     {
00095         $resource = Mage::getSingleton('core/resource');
00096 
00097         $this->_visitorTable    = $resource->getTableName('log/visitor');
00098         $this->_visitorInfoTable= $resource->getTableName('log/visitor_info');
00099         $this->_urlTable        = $resource->getTableName('log/url_table');
00100         $this->_urlInfoTable    = $resource->getTableName('log/url_info_table');
00101         $this->_customerTable   = $resource->getTableName('log/customer');
00102         $this->_quoteTable      = $resource->getTableName('log/quote_table');
00103 
00104         $this->_read = $resource->getConnection('log_read');
00105         $this->_write = $resource->getConnection('log_write');
00106     }


Member Function Documentation

load ( object,
customerId 
)

Definition at line 108 of file Customer.php.

00109     {
00110         $select = $this->_read->select();
00111         $select->from($this->_customerTable, array('login_at', 'logout_at'))
00112             ->joinInner($this->_visitorTable, $this->_visitorTable.'.visitor_id='.$this->_customerTable.'.visitor_id', array('last_visit_at'))
00113             ->joinInner($this->_visitorInfoTable, $this->_visitorTable.'.visitor_id='.$this->_visitorInfoTable.'.visitor_id', array('http_referer', 'remote_addr'))
00114             ->joinInner($this->_urlInfoTable, $this->_urlInfoTable.'.url_id='.$this->_visitorTable.'.last_url_id', array('url'))
00115             ->where($this->_read->quoteInto($this->_customerTable.'.customer_id=?', $customerId))
00116             ->order($this->_customerTable.'.login_at desc')
00117             ->limit(1);
00118         $object->setData($this->_read->fetchRow($select));
00119         return $object;
00120     }


Member Data Documentation

$_customerTable [protected]

Definition at line 56 of file Customer.php.

$_quoteTable [protected]

Definition at line 77 of file Customer.php.

$_read [protected]

Definition at line 84 of file Customer.php.

$_urlInfoTable [protected]

Definition at line 63 of file Customer.php.

$_urlTable [protected]

Definition at line 70 of file Customer.php.

$_visitorInfoTable [protected]

Definition at line 49 of file Customer.php.

$_visitorTable [protected]

Definition at line 42 of file Customer.php.

$_write [protected]

Definition at line 91 of file Customer.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:28 2009 for Magento by  doxygen 1.5.8