*/ class Mage_Log_Model_Customer extends Mage_Core_Model_Abstract { /** * Define resource model * */ protected function _construct() { parent::_construct(); $this->_init('log/customer'); } /** * Load last log by customer id * * @param Mage_Customer_Model_Customer|int $customer * @return Mage_Log_Model_Customer */ public function loadByCustomer($customer) { if ($customer instanceof Mage_Customer_Model_Customer) { $customer = $customer->getId(); } return $this->load($customer, 'customer_id'); } /** * Return last login at in Unix time format * * @return int */ public function getLoginAtTimestamp() { $loginAt = $this->getLoginAt(); if ($loginAt) { return Varien_Date::toTimestamp($loginAt); } return null; } }