ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilMailTransportSettings Class Reference
+ Collaboration diagram for ilMailTransportSettings:

Public Member Functions

 __construct (ilMailOptions $mailOptions)
 
 adjust ($firstMail, $secondMail)
 Validates the current instance settings and eventually adjusts these. More...
 

Private Attributes

 $mailOptions
 

Detailed Description

Author
Niels Theen nthee.nosp@m.n@da.nosp@m.tabay.nosp@m..de
Version
$Id$

Definition at line 8 of file class.ilMailTransportSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilMailTransportSettings::__construct ( ilMailOptions  $mailOptions)

Definition at line 12 of file class.ilMailTransportSettings.php.

References $mailOptions.

13  {
14  $this->mailOptions = $mailOptions;
15  }

Member Function Documentation

◆ adjust()

ilMailTransportSettings::adjust (   $firstMail,
  $secondMail 
)

Validates the current instance settings and eventually adjusts these.

Parameters
string$firstMail
string$secondMail
Returns
int|string|void

Definition at line 23 of file class.ilMailTransportSettings.php.

References ilMailOptions\FIRST_EMAIL, ilMailOptions\INCOMING_LOCAL, and ilMailOptions\SECOND_EMAIL.

24  {
25  if ($this->mailOptions->getIncomingType() === ilMailOptions::INCOMING_LOCAL) {
26  return;
27  }
28 
29  $hasFirstEmail = strlen($firstMail);
30  $hasSecondEmail = strlen($secondMail);
31 
32  if (!$hasFirstEmail && !$hasSecondEmail) {
33  $this->mailOptions->setIncomingType(ilMailOptions::INCOMING_LOCAL);
34  return $this->mailOptions->updateOptions();
35  }
36 
37  if (!$hasFirstEmail && $this->mailOptions->getMailAddressOption() !== ilMailOptions::SECOND_EMAIL) {
38  $this->mailOptions->setMailAddressOption(ilMailOptions::SECOND_EMAIL);
39  return $this->mailOptions->updateOptions();
40  }
41 
42  if (!$hasSecondEmail && $this->mailOptions->getMailAddressOption() !== ilMailOptions::FIRST_EMAIL) {
43  $this->mailOptions->setMailAddressOption(ilMailOptions::FIRST_EMAIL);
44  return $this->mailOptions->updateOptions();
45  }
46  }

Field Documentation

◆ $mailOptions

ilMailTransportSettings::$mailOptions
private

Definition at line 10 of file class.ilMailTransportSettings.php.

Referenced by __construct().


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