Elgg  Version 4.x
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Elgg\Database\DelayedEmailQueueTable Class Reference

Interfaces with the database to perform operations on the delayed_email_queue table. More...

Public Member Functions

 __construct (Database $db)
 Create new service. More...
 
 queueEmail (int $recipient_guid, string $delivery_interval, $item)
 Insert a delayed email into the queue. More...
 
 getRow (int $id)
 Get a row from the queue. More...
 
 getRecipientRows (int $recipient_guid, string $delivery_interval, int $timestamp=null)
 Get all the rows in the queue for a given recipient. More...
 
 getIntervalRows (string $delivery_interval, int $timestamp=null)
 Get the queued items from the database for a given interval. More...
 
 deleteRow (int $id)
 Remove a queue items from the database. More...
 
 deleteRecipientRows (int $recipient_guid, string $delivery_interval, int $timestamp=null)
 Delete all the queue items from the database for the given recipient and interval. More...
 
 deleteAllRecipientRows (int $recipient_guid)
 Deletes all the queue items from the database for the given recipient. More...
 
 updateRecipientInterval (int $recipient_guid, string $delivery_interval)
 Update the queued notifications for the recipient to a new delivery interval. More...
 
 rowToRecord (\stdClass $row)
 Convert a database row to a managable object. More...
 

Public Attributes

const TABLE_NAME = 'delayed_email_queue'
 

Protected Attributes

 $db
 

Detailed Description

Interfaces with the database to perform operations on the delayed_email_queue table.

Definition at line 15 of file DelayedEmailQueueTable.php.

Constructor & Destructor Documentation

Elgg\Database\DelayedEmailQueueTable::__construct ( Database  $db)

Create new service.

Parameters
Database$dbthe database service

Definition at line 34 of file DelayedEmailQueueTable.php.

Member Function Documentation

Elgg\Database\DelayedEmailQueueTable::deleteAllRecipientRows ( int  $recipient_guid)

Deletes all the queue items from the database for the given recipient.

Parameters
int$recipient_guidthe recipient
Returns
int number of deleted rows

Definition at line 151 of file DelayedEmailQueueTable.php.

Elgg\Database\DelayedEmailQueueTable::deleteRecipientRows ( int  $recipient_guid,
string  $delivery_interval,
int  $timestamp = null 
)

Delete all the queue items from the database for the given recipient and interval.

Parameters
int$recipient_guidthe recipient
string$delivery_intervalthe interval for the recipient
int$timestamp(optional) all queue items before time (default: now)
Returns
int number of deleted rows

Definition at line 135 of file DelayedEmailQueueTable.php.

Elgg\Database\DelayedEmailQueueTable::deleteRow ( int  $id)

Remove a queue items from the database.

Parameters
int$idthe row to delete
Returns
int number of deleted rows

Definition at line 119 of file DelayedEmailQueueTable.php.

Elgg\Database\DelayedEmailQueueTable::getIntervalRows ( string  $delivery_interval,
int  $timestamp = null 
)

Get the queued items from the database for a given interval.

Parameters
string$delivery_intervalthe delivery interval to get
int$timestamp(optional) all queue items before time (default: now)
Returns
DatabaseRecord[]

Definition at line 101 of file DelayedEmailQueueTable.php.

Elgg\Database\DelayedEmailQueueTable::getRecipientRows ( int  $recipient_guid,
string  $delivery_interval,
int  $timestamp = null 
)

Get all the rows in the queue for a given recipient.

Parameters
int$recipient_guidthe recipient
string$delivery_intervalthe interval for the recipient
int$timestamp(optional) all queue items before time (default: now)
Returns
DatabaseRecord[] database rows

Definition at line 83 of file DelayedEmailQueueTable.php.

Elgg\Database\DelayedEmailQueueTable::getRow ( int  $id)

Get a row from the queue.

Parameters
int$idthe ID to fetch
Returns
null|DatabaseRecord database row

Definition at line 66 of file DelayedEmailQueueTable.php.

Elgg\Database\DelayedEmailQueueTable::queueEmail ( int  $recipient_guid,
string  $delivery_interval,
  $item 
)

Insert a delayed email into the queue.

Parameters
int$recipient_guidthe recipient of the email
string$delivery_intervalthe desired interval of the recipient
mixed$itemthe email to queue
Returns
bool

Definition at line 47 of file DelayedEmailQueueTable.php.

Elgg\Database\DelayedEmailQueueTable::rowToRecord ( \stdClass  $row)

Convert a database row to a managable object.

Parameters
\stdClass$rowthe database record
Returns
DatabaseRecord

Definition at line 181 of file DelayedEmailQueueTable.php.

Elgg\Database\DelayedEmailQueueTable::updateRecipientInterval ( int  $recipient_guid,
string  $delivery_interval 
)

Update the queued notifications for the recipient to a new delivery interval.

Parameters
int$recipient_guidthe recipient
string$delivery_intervalthe new delivery interval
Returns
bool

Definition at line 166 of file DelayedEmailQueueTable.php.

Member Data Documentation

Elgg\Database\DelayedEmailQueueTable::$db
protected

Definition at line 27 of file DelayedEmailQueueTable.php.

const Elgg\Database\DelayedEmailQueueTable::TABLE_NAME = 'delayed_email_queue'

Definition at line 22 of file DelayedEmailQueueTable.php.


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