Mage_Sendfriend_Model_Mysql4_Sendfriend Class Reference

Inheritance diagram for Mage_Sendfriend_Model_Mysql4_Sendfriend:

Mage_Core_Model_Mysql4_Abstract Mage_Core_Model_Resource_Abstract

List of all members.

Public Member Functions

 getSendCount ($model, $ip, $startTime)
 deleteLogsBefore ($time)

Protected Member Functions

 _construct ()


Detailed Description

Definition at line 27 of file Sendfriend.php.


Member Function Documentation

_construct (  )  [protected]

Resource initialization

Reimplemented from Mage_Core_Model_Resource_Abstract.

Definition at line 29 of file Sendfriend.php.

00030     {
00031         $this->_init('sendfriend/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     }


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

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