Class IMP_Sentmail_sql

Description

IMP_Sentmail implementation for PHP's PEAR database abstraction layer.

Required values for $params:

      'phptype'       The database type (e.g. 'pgsql', 'mysql', etc.).
      'table'         The name of the foo table in 'database'.

Required by some database implementations:

      'database'      The name of the database.
      'hostspec'      The hostname of the database server.
      'protocol'      The communication protocol ('tcp', 'unix', etc.).
      'username'      The username with which to connect to the database.
      'password'      The password associated with 'username'.
      'options'       Additional options to pass to the database.
      'tty'           The TTY on which to connect to the database.
      'port'          The port on which to connect to the database.

The table structure can be created by the scripts/sql/imp_sentmail.sql script.

$Horde: imp/lib/Sentmail/sql.php,v 1.12.2.3 2010/07/28 05:19:39 mrubinsk Exp $

Located in /lib/Sentmail/sql.php (line 28)

IMP_Sentmail
   |
   --IMP_Sentmail_sql
Variable Summary
 DB $_db
 array $_params
Method Summary
 IMP_Sentmail_sql IMP_Sentmail_sql ([array $params = array()])
 array favouriteRecipients (integer $limit, [array $filter = array('new', 'forward', 'reply', 'redirect')])
 boolean initialize ()
 integer numberOfRecipients (integer $hours, [boolean $user = false])
 void _deleteOldEntries (integer $before)
 void _log (string $action, string $message_id,  $recipient, boolean $success, string $recipients)
Variables
DB $_db (line 42)

Handle for the current database connection.

array $_params = array() (line 35)

Hash containing connection parameters.

Methods
Constructor IMP_Sentmail_sql (line 49)

Constructor.

IMP_Sentmail_sql IMP_Sentmail_sql ([array $params = array()])
  • array $params: A hash containing connection parameters.
favouriteRecipients (line 98)

Returns the most favourite recipients.

  • return: A list with the $limit most favourite recipients.
array favouriteRecipients (integer $limit, [array $filter = array('new', 'forward', 'reply', 'redirect')])
  • integer $limit: Return this number of recipients.
  • array $filter: A list of messages types that should be returned. A value of null returns all message types.

Redefinition of:
IMP_Sentmail::favouriteRecipients()
Returns the most favourite recipients.
initialize (line 192)

Attempts to open a connection to the SQL server.

  • return: True on success, PEAR_Error on failure.
boolean initialize ()
numberOfRecipients (line 141)

Returns the number of recipients within a certain time period.

  • return: The number of recipients in the given time period.
integer numberOfRecipients (integer $hours, [boolean $user = false])
  • integer $hours: Time period in hours.
  • boolean $user: Return the number of recipients for the current user?

Redefinition of:
IMP_Sentmail::numberOfRecipients()
Returns the number of recipients within a certain time period.
_deleteOldEntries (line 169)

Deletes all log entries older than a certain date.

void _deleteOldEntries (integer $before)
  • integer $before: Unix timestamp before that all log entries should be deleted.

Redefinition of:
IMP_Sentmail::_deleteOldEntries()
Deletes all log entries older than a certain date.
_log (line 63)

Logs an attempt to send a message per recipient.

void _log (string $action, string $message_id,  $recipient, boolean $success, string $recipients)
  • string $action: Why the message was sent, i.e. "new", "reply", "forward", etc.
  • string $message_id: The Message-ID.
  • string $recipients: A message recipient.
  • boolean $success: Whether the attempt was successful.
  • $recipient

Redefinition of:
IMP_Sentmail::_log()
Logs an attempt to send a message per recipient.

Inherited Methods

Inherited From IMP_Sentmail

 IMP_Sentmail::factory()
 IMP_Sentmail::favouriteRecipients()
 IMP_Sentmail::gc()
 IMP_Sentmail::log()
 IMP_Sentmail::numberOfRecipients()
 IMP_Sentmail::_deleteOldEntries()
 IMP_Sentmail::_log()

Documentation generated on Sun, 30 Jan 2011 05:28:17 +0000 by phpDocumentor 1.4.3