ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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.

References $collector, $DIC, Vendor\Package\$e, $i, $job, $res, ilUtil\delDir(), ilLoggerFactory\getLogger(), settings(), and ilDBConstants\T_TEXT.

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  }
settings()
Definition: settings.php:2
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ deleteMails()

ilMailCronOrphanedMailsDeletionProcessor::deleteMails ( )
private

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

Referenced by processDeletion().

144  {
145  $this->db->manipulate('DELETE FROM mail WHERE ' . $this->db->in('mail_id', $this->collector->getMailIdsToDelete(), false, 'integer'));
146  }
+ 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.

References settings().

Referenced by processDeletion().

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  }
settings()
Definition: settings.php:2
+ 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.

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

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.
+ 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: