53 return $this->db->insertData($insert) !==
false;
68 return $this->db->getDataRow($select, [$this,
'rowToRecord']);
83 ->where($select->compare(
'recipient_guid',
'=', $recipient_guid,
ELGG_VALUE_GUID))
84 ->andWhere($select->compare(
'delivery_interval',
'=', $delivery_interval,
ELGG_VALUE_STRING))
87 return $this->db->getData($select, [$this,
'rowToRecord']);
101 ->where($select->compare(
'delivery_interval',
'=', $delivery_interval,
ELGG_VALUE_STRING))
102 ->andWhere($select->compare(
'timestamp',
'<',
$timestamp ?? $this->getCurrentTime()->getTimestamp()))
103 ->orderBy(
'recipient_guid',
'ASC')
104 ->addOrderBy(
'timestamp',
'ASC');
106 return $this->db->getData($select, [$this,
'rowToRecord']);
120 return $this->db->deleteData(
$delete);
138 return $this->db->deleteData(
$delete);
152 return $this->db->deleteData(
$delete);
165 $update->set(
'delivery_interval', $update->param($delivery_interval,
ELGG_VALUE_STRING))
166 ->where($update->compare(
'recipient_guid',
'=', $recipient_guid,
ELGG_VALUE_GUID));
168 return $this->db->updateData($update);
getIntervalRows(string $delivery_interval, int $timestamp=null)
Get the queued items from the database for a given interval.
deleteRecipientRows(int $recipient_guid, string $delivery_interval, int $timestamp=null)
Delete all the queue items from the database for the given recipient and interval.
queueEmail(int $recipient_guid, string $delivery_interval, $item)
Insert a delayed email into the queue.
static table($table, $alias=null)
{}
const ELGG_VALUE_INTEGER
Value types.
trait TimeUsing
Adds methods for setting the current time (for testing)
getCurrentTime($modifier= '')
Get the (cloned) time.
static intoTable($table)
{}
getRecipientRows(int $recipient_guid, string $delivery_interval, int $timestamp=null)
Get all the rows in the queue for a given recipient.
rowToRecord(\stdClass $row)
Convert a database row to a managable object.
deleteAllRecipientRows(int $recipient_guid)
Deletes all the queue items from the database for the given recipient.
deleteRow(int $id)
Remove a queue items from the database.
Interfaces with the database to perform operations on the delayed_email_queue table.
const ELGG_VALUE_TIMESTAMP
static fromTable($table, $alias=null)
{}
updateRecipientInterval(int $recipient_guid, string $delivery_interval)
Update the queued notifications for the recipient to a new delivery interval.
__construct(Database $db)
Create new service.
getRow(int $id)
Get a row from the queue.
$id
Generic annotation delete action.
static fromTable($table, $alias=null)
{}