19declare(strict_types=1);
32readonly
class OutboxDatabaseRepository
implements OutboxRepository
36 private ClockFactory $clock,
44 public function getOutboxMails(): Generator
46 $res = $this->db->queryF(
60 INNER JOIN mail_obj_data ON mail.folder_id = mail_obj_data.obj_id AND mail.user_id = mail_obj_data.user_id
61 WHERE mail_obj_data.m_type = %s
62 AND schedule_datetime IS NOT
NULL
67 $current_time = $this->clock->utc()->now();
69 while ($row = $this->mail->fetchMailData($this->db->fetchAssoc(
$res))) {
70 $schedule_datetime =
new DateTimeImmutable(
71 $row[
'schedule_datetime'],
72 new DateTimeZone($row[
'schedule_timezone'])
74 if ($schedule_datetime <= $current_time) {
82 (
bool) ($row[
'use_placeholders'] ??
false),
83 isset($row[
'mail_id']) ? (
int) $row[
'mail_id'] :
null
__construct()
Constructor setup ILIAS global object @access public.