Elgg  Version 6.1
Public Member Functions | Public 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 (protected 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, int $max_results=0)
 Get all the rows in the queue for a given recipient. More...
 
 getNextRecipientGUID (string $delivery_interval, int $timestamp=null)
 Fetch the GUID of the next recipient to process. More...
 
 deleteRow (int $id)
 Remove a queue items from the database. More...
 
 deleteRecipientRows (int $recipient_guid, string $delivery_interval, int $timestamp=null, int $max_id=0)
 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 manageable object. More...
 

Public Attributes

const TABLE_NAME = 'delayed_email_queue'
 

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 ( protected Database  $db)

Create new service.

Parameters
Database$dbthe database service

Definition at line 29 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 165 of file DelayedEmailQueueTable.php.

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

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
null | int$timestamp(optional) all queue items before time (default: now)
int$max_id(optional) the max row ID to remove (this includes the given row ID)
Returns
int number of deleted rows

Definition at line 143 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 126 of file DelayedEmailQueueTable.php.

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

Fetch the GUID of the next recipient to process.

Parameters
string$delivery_intervalthe delivery interval to get
null | int$timestamp(optional) based on queue items before time (default: now)
Returns
null|int

Definition at line 102 of file DelayedEmailQueueTable.php.

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

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

Parameters
int$recipient_guidthe recipient
string$delivery_intervalthe interval for the recipient
null | int$timestamp(optional) all queue items before time (default: now)
int$max_results(optional) maximum number of rows to return
Returns
DatabaseRecord[] database rows

Definition at line 78 of file DelayedEmailQueueTable.php.

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

Get a row from the queue.

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

Definition at line 60 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 41 of file DelayedEmailQueueTable.php.

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

Convert a database row to a manageable object.

Parameters
\stdClass$rowthe database record
Returns
DatabaseRecord

Definition at line 195 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 180 of file DelayedEmailQueueTable.php.

Member Data Documentation

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: