ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilBaseMailAddressType Class Reference

Class ilBaseMailAddressType. More...

+ Inheritance diagram for ilBaseMailAddressType:
+ Collaboration diagram for ilBaseMailAddressType:

Public Member Functions

 __construct (\ilMailAddressTypeHelper $typeHelper, \ilMailAddress $address, \ilLogger $logger)
 ilBaseMailAddressType constructor. More...
 
 validate (int $senderId)
 Validates the parsed recipients and set errors accordingly.
See also
::getErrors
Parameters
$senderIdinteger The id of the acting ILIAS user, can be used for permission checks etc.
Returns
bool
More...
 
 getErrors ()
 Returns a list of errors determined in the validation process.The errors should be reset everytime the validation is triggered.

See also
::validate
Returns
More...
 
 getAddress ()
 The address instance used for validation and user id lookup.
Returns
More...
 
- Public Member Functions inherited from ilMailAddressType
 resolve ()
 Returns an array of resolved user ids based on an address instance. More...
 

Protected Member Functions

 isValid (int $senderId)
 
 pushError (string $languageVariable, array $placeHolderValues=[])
 

Protected Attributes

 $typeHelper
 
 $address
 
 $logger
 

Private Member Functions

 resetErrors ()
 

Private Attributes

 $errors = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilBaseMailAddressType::__construct ( \ilMailAddressTypeHelper  $typeHelper,
\ilMailAddress  $address,
\ilLogger  $logger 
)

ilBaseMailAddressType constructor.

Parameters
\ilMailAddressTypeHelper$typeHelper
\ilMailAddress$address
\ilLogger$logger

Definition at line 28 of file class.ilBaseMailAddressType.php.

References $address, $logger, $typeHelper, and isValid().

32  {
33  $this->address = $address;
34  $this->typeHelper = $typeHelper;
35  $this->logger = $logger;
36  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getAddress()

ilBaseMailAddressType::getAddress ( )

The address instance used for validation and user id lookup.

Returns

Implements ilMailAddressType.

Definition at line 82 of file class.ilBaseMailAddressType.php.

References $address.

83  {
84  return $this->address;
85  }
Class ilMailAddress.

◆ getErrors()

ilBaseMailAddressType::getErrors ( )

Returns a list of errors determined in the validation process.The errors should be reset everytime the validation is triggered.

See also
::validate
Returns

Implements ilMailAddressType.

Definition at line 74 of file class.ilBaseMailAddressType.php.

References $errors.

74  : array
75  {
76  return $this->errors;
77  }

◆ isValid()

ilBaseMailAddressType::isValid ( int  $senderId)
abstractprotected
Parameters
$senderIdinteger
Returns
bool

Referenced by __construct(), and validate().

+ Here is the caller graph for this function:

◆ pushError()

ilBaseMailAddressType::pushError ( string  $languageVariable,
array  $placeHolderValues = [] 
)
protected
Parameters
string$languageVariable
array$placeHolderValues

Definition at line 58 of file class.ilBaseMailAddressType.php.

Referenced by ilMailLoginOrEmailAddressAddressType\isValid(), ilMailMailingListAddressType\isValid(), and ilMailRoleAddressType\isValid().

59  {
60  $this->errors[] = new \ilMailError($languageVariable, $placeHolderValues);
61  }
+ Here is the caller graph for this function:

◆ resetErrors()

ilBaseMailAddressType::resetErrors ( )
private

Definition at line 66 of file class.ilBaseMailAddressType.php.

Referenced by validate().

67  {
68  $this->errors = [];
69  }
+ Here is the caller graph for this function:

◆ validate()

ilBaseMailAddressType::validate ( int  $senderId)

Validates the parsed recipients and set errors accordingly.

See also
::getErrors
Parameters
$senderIdinteger The id of the acting ILIAS user, can be used for permission checks etc.
Returns
bool

Implements ilMailAddressType.

Definition at line 47 of file class.ilBaseMailAddressType.php.

References isValid(), and resetErrors().

47  : bool
48  {
49  $this->resetErrors();
50 
51  return $this->isValid($senderId);
52  }
isValid(int $senderId)
+ Here is the call graph for this function:

Field Documentation

◆ $address

ilBaseMailAddressType::$address
protected

◆ $errors

ilBaseMailAddressType::$errors = []
private

Definition at line 20 of file class.ilBaseMailAddressType.php.

Referenced by getErrors().

◆ $logger

ilBaseMailAddressType::$logger
protected

Definition at line 17 of file class.ilBaseMailAddressType.php.

Referenced by __construct().

◆ $typeHelper

ilBaseMailAddressType::$typeHelper
protected

Definition at line 11 of file class.ilBaseMailAddressType.php.

Referenced by __construct().


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