7 use Elgg\Traits\TimeUsing;
50 return $this->db->insertData($insert) !== 0;
61 $select =
Select::fromTable(self::TABLE_NAME);
65 return $this->db->getDataRow($select, [$this,
'rowToRecord']);
79 $select =
Select::fromTable(self::TABLE_NAME);
82 ->andWhere($select->compare(
'delivery_interval',
'=', $delivery_interval,
ELGG_VALUE_STRING))
85 ->addOrderBy(
'id',
'ASC');
87 if ($max_results > 0) {
88 $select->setMaxResults($max_results);
91 return $this->db->getData($select, [$this,
'rowToRecord']);
103 $select =
Select::fromTable(self::TABLE_NAME);
104 $select->select(
'recipient_guid')
105 ->where($select->compare(
'delivery_interval',
'=', $delivery_interval,
ELGG_VALUE_STRING))
106 ->andWhere($select->compare(
'timestamp',
'<',
$timestamp ?? $this->getCurrentTime()->getTimestamp()))
108 ->addOrderBy(
'id',
'ASC')
111 $row = $this->db->getDataRow($select);
116 return (
int) $row->recipient_guid;
130 return $this->db->deleteData(
$delete);
148 ->orderBy(
'timestamp',
'ASC')
149 ->addOrderBy(
'id',
'ASC');
155 return $this->db->deleteData(
$delete);
169 return $this->db->deleteData(
$delete);
181 $update =
Update::table(self::TABLE_NAME);
182 $update->set(
'delivery_interval', $update->param($delivery_interval,
ELGG_VALUE_STRING))
185 return $this->db->updateData($update);
$id
Generic annotation delete action.
return[ 'admin/delete_admin_notices'=>['access'=> 'admin'], 'admin/menu/save'=>['access'=> 'admin'], 'admin/plugins/activate'=>['access'=> 'admin'], 'admin/plugins/activate_all'=>['access'=> 'admin'], 'admin/plugins/deactivate'=>['access'=> 'admin'], 'admin/plugins/deactivate_all'=>['access'=> 'admin'], 'admin/plugins/set_priority'=>['access'=> 'admin'], 'admin/security/security_txt'=>['access'=> 'admin'], 'admin/security/settings'=>['access'=> 'admin'], 'admin/security/regenerate_site_secret'=>['access'=> 'admin'], 'admin/site/cache/invalidate'=>['access'=> 'admin'], 'admin/site/flush_cache'=>['access'=> 'admin'], 'admin/site/icons'=>['access'=> 'admin'], 'admin/site/set_maintenance_mode'=>['access'=> 'admin'], 'admin/site/set_robots'=>['access'=> 'admin'], 'admin/site/theme'=>['access'=> 'admin'], 'admin/site/unlock_upgrade'=>['access'=> 'admin'], 'admin/site/settings'=>['access'=> 'admin'], 'admin/upgrade'=>['access'=> 'admin'], 'admin/upgrade/reset'=>['access'=> 'admin'], 'admin/user/ban'=>['access'=> 'admin'], 'admin/user/bulk/ban'=>['access'=> 'admin'], 'admin/user/bulk/delete'=>['access'=> 'admin'], 'admin/user/bulk/unban'=>['access'=> 'admin'], 'admin/user/bulk/validate'=>['access'=> 'admin'], 'admin/user/change_email'=>['access'=> 'admin'], 'admin/user/delete'=>['access'=> 'admin'], 'admin/user/login_as'=>['access'=> 'admin'], 'admin/user/logout_as'=>[], 'admin/user/makeadmin'=>['access'=> 'admin'], 'admin/user/resetpassword'=>['access'=> 'admin'], 'admin/user/removeadmin'=>['access'=> 'admin'], 'admin/user/unban'=>['access'=> 'admin'], 'admin/user/validate'=>['access'=> 'admin'], 'annotation/delete'=>[], 'avatar/upload'=>[], 'comment/save'=>[], 'diagnostics/download'=>['access'=> 'admin'], 'entity/chooserestoredestination'=>[], 'entity/delete'=>[], 'entity/mute'=>[], 'entity/restore'=>[], 'entity/subscribe'=>[], 'entity/trash'=>[], 'entity/unmute'=>[], 'entity/unsubscribe'=>[], 'login'=>['access'=> 'logged_out'], 'logout'=>[], 'notifications/mute'=>['access'=> 'public'], 'plugins/settings/remove'=>['access'=> 'admin'], 'plugins/settings/save'=>['access'=> 'admin'], 'plugins/usersettings/save'=>[], 'register'=>['access'=> 'logged_out', 'middleware'=>[\Elgg\Router\Middleware\RegistrationAllowedGatekeeper::class,],], 'river/delete'=>[], 'settings/notifications'=>[], 'settings/notifications/subscriptions'=>[], 'user/changepassword'=>['access'=> 'public'], 'user/requestnewpassword'=>['access'=> 'public'], 'useradd'=>['access'=> 'admin'], 'usersettings/save'=>[], 'widgets/add'=>[], 'widgets/delete'=>[], 'widgets/move'=>[], 'widgets/save'=>[],]
Interfaces with the database to perform operations on the delayed_email_queue table.
deleteRow(int $id)
Remove a queue items from the database.
getRow(int $id)
Get a row from the queue.
queueEmail(int $recipient_guid, string $delivery_interval, $item)
Insert a delayed email into the queue.
rowToRecord(\stdClass $row)
Convert a database row to a manageable object.
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.
__construct(protected Database $db)
Create new service.
updateRecipientInterval(int $recipient_guid, string $delivery_interval)
Update the queued notifications for the recipient to a new delivery interval.
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.
getNextRecipientGUID(string $delivery_interval, ?int $timestamp=null)
Fetch the GUID of the next recipient to process.
deleteAllRecipientRows(int $recipient_guid)
Deletes all the queue items from the database for the given recipient.
Query builder for updating data in the database.
Query builder for inserting data into the database.
orderBy(string $sort, ?string $order=null)
{}
Query builder for fetching data from the database.
Query builder for updating data in the database.
const ELGG_VALUE_TIMESTAMP
const ELGG_VALUE_INTEGER
Value types.
foreach($recommendedExtensions as $extension) if(empty(ini_get('session.gc_probability'))||empty(ini_get('session.gc_divisor'))) $db