ILIAS  release_7 Revision v7.30-3-g800a261c036
ilMailCronOrphanedMailsDeletionProcessor Class Reference

ilMailCronOrphanedMailsDeletionProcessor More...

+ Collaboration diagram for ilMailCronOrphanedMailsDeletionProcessor:

Public Member Functions

 __construct (ilMailCronOrphanedMails $job, ilMailCronOrphanedMailsDeletionCollector $collector)
 
 processDeletion ()
 

Protected Attributes

 $collector
 
 $db
 
 $settings
 

Private Member Functions

 deleteMails ()
 
 deleteMarkedAsNotified ()
 Delete entries about notification. More...
 

Private Attributes

const PING_THRESHOLD = 250
 
 $job
 
 $mail_ids_for_path_stmt
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMailCronOrphanedMailsDeletionProcessor::__construct ( ilMailCronOrphanedMails  $job,
ilMailCronOrphanedMailsDeletionCollector  $collector 
)
Parameters
ilMailCronOrphanedMailsDeletionCollector$collector

Definition at line 34 of file class.ilMailCronOrphanedMailsDeletionProcessor.php.

35 {
36 global $DIC;
37
38 $this->settings = $DIC->settings();
39 $this->db = $DIC->database();
40
41 $this->job = $job;
42 $this->collector = $collector;
43
44 $this->mail_ids_for_path_stmt = $this->db->prepare(
45 'SELECT COUNT(*) cnt FROM mail_attachment WHERE path = ?',
47 );
48 }
global $DIC
Definition: goto.php:24
settings()
Definition: settings.php:2

References $collector, $DIC, $job, settings(), and ilDBConstants\T_TEXT.

+ Here is the call graph for this function:

Member Function Documentation

◆ deleteMails()

ilMailCronOrphanedMailsDeletionProcessor::deleteMails ( )
private

Definition at line 143 of file class.ilMailCronOrphanedMailsDeletionProcessor.php.

144 {
145 $this->db->manipulate('DELETE FROM mail WHERE ' . $this->db->in('mail_id', $this->collector->getMailIdsToDelete(), false, 'integer'));
146 }

Referenced by processDeletion().

+ Here is the caller graph for this function:

◆ deleteMarkedAsNotified()

ilMailCronOrphanedMailsDeletionProcessor::deleteMarkedAsNotified ( )
private

Delete entries about notification.

Definition at line 151 of file class.ilMailCronOrphanedMailsDeletionProcessor.php.

152 {
153 if ((int) $this->settings->get('mail_notify_orphaned') >= 1) {
154 $this->db->manipulate('DELETE FROM mail_cron_orphaned WHERE ' . $this->db->in('mail_id', $this->collector->getMailIdsToDelete(), false, 'integer'));
155 } else {
156 $this->db->manipulate('DELETE FROM mail_cron_orphaned');
157 }
158 }

References settings().

Referenced by processDeletion().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processDeletion()

ilMailCronOrphanedMailsDeletionProcessor::processDeletion ( )

Definition at line 163 of file class.ilMailCronOrphanedMailsDeletionProcessor.php.

164 {
165 if (count($this->collector->getMailIdsToDelete()) > 0) {
166 // delete possible attachments ...
167 $this->deleteAttachments();
168
169 $this->deleteMails();
170 require_once './Services/Logging/classes/public/class.ilLoggerFactory.php';
171 ilLoggerFactory::getLogger('mail')->info(sprintf(
172 'Deleted mail_ids: %s',
173 implode(', ', $this->collector->getMailIdsToDelete())
174 ));
175
176 $this->deleteMarkedAsNotified();
177 ilLoggerFactory::getLogger('mail')->info(sprintf(
178 'Deleted mail_cron_orphaned mail_ids: %s',
179 implode(', ', $this->collector->getMailIdsToDelete())
180 ));
181 }
182 }
static getLogger($a_component_id)
Get component logger.

References deleteMails(), deleteMarkedAsNotified(), and ilLoggerFactory\getLogger().

+ Here is the call graph for this function:

Field Documentation

◆ $collector

ilMailCronOrphanedMailsDeletionProcessor::$collector
protected

Definition at line 18 of file class.ilMailCronOrphanedMailsDeletionProcessor.php.

Referenced by __construct().

◆ $db

ilMailCronOrphanedMailsDeletionProcessor::$db
protected

◆ $job

ilMailCronOrphanedMailsDeletionProcessor::$job
private

Definition at line 14 of file class.ilMailCronOrphanedMailsDeletionProcessor.php.

Referenced by __construct().

◆ $mail_ids_for_path_stmt

ilMailCronOrphanedMailsDeletionProcessor::$mail_ids_for_path_stmt
private

◆ $settings

ilMailCronOrphanedMailsDeletionProcessor::$settings
protected

◆ PING_THRESHOLD

const ilMailCronOrphanedMailsDeletionProcessor::PING_THRESHOLD = 250
private

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