Public Member Functions | |
getSendCount ($model, $ip, $startTime) | |
deleteLogsBefore ($time) | |
Protected Member Functions | |
_construct () |
Definition at line 27 of file Sendfriend.php.
_construct | ( | ) | [protected] |
Resource initialization
Reimplemented from Mage_Core_Model_Resource_Abstract.
Definition at line 29 of file Sendfriend.php.
00030 { 00031 $this->_init('catalog/sendfriend', 'log_id'); 00032 }
deleteLogsBefore | ( | $ | time | ) |
Definition at line 46 of file Sendfriend.php.
00047 { 00048 $deleted = $this->_getWriteAdapter() 00049 ->delete($this->getTable('sendfriend'), $this->_getWriteAdapter()->quoteInto('time < ?', $time)); 00050 00051 return $this; 00052 }
getSendCount | ( | $ | model, | |
$ | ip, | |||
$ | startTime | |||
) |
Definition at line 34 of file Sendfriend.php.
00035 { 00036 $select = $this->_getReadAdapter()->select() 00037 ->from(array('main_table' => $this->getTable('sendfriend')), new Zend_Db_Expr('count(*)')) 00038 ->where('main_table.ip = ?', $ip) 00039 ->where('main_table.time >= ?', $startTime); 00040 00041 $data = $this->_getReadAdapter()->fetchRow($select); 00042 00043 return $data['count(*)']; 00044 }