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
\ilMailAddressType::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
\ilMailAddressType::validate
Returns
\ilMailError
More...
 
 getAddress ()
 The address instance used for validation and user id lookup.
Returns
\ilMailAddress
More...
 
- Public Member Functions inherited from ilMailAddressType
 resolve ()
 Returns an array of resolved user ids based on an address instance. More...
 
 validate (int $senderId)
 Validates the parsed recipients and set errors accordingly. More...
 
 getErrors ()
 Returns a list of errors determined in the validation process. More...
 
 getAddress ()
 The address instance used for validation and user id lookup. 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, and $typeHelper.

Member Function Documentation

◆ getAddress()

ilBaseMailAddressType::getAddress ( )

The address instance used for validation and user id lookup.

Returns
\ilMailAddress

Implements ilMailAddressType.

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

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

References $address.

◆ 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
\ilMailAddressType::validate
Returns
\ilMailError

Implements ilMailAddressType.

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

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

References $errors.

◆ isValid()

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

Reimplemented in ilMailGroupAddressType, ilMailLoginOrEmailAddressAddressType, ilMailMailingListAddressType, and ilMailRoleAddressType.

Referenced by 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.

59 {
60 $this->errors[] = new \ilMailError($languageVariable, $placeHolderValues);
61 }

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

+ Here is the caller graph for this function:

◆ resetErrors()

ilBaseMailAddressType::resetErrors ( )
private

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

67 {
68 $this->errors = [];
69 }

Referenced by validate().

+ Here is the caller graph for this function:

◆ validate()

ilBaseMailAddressType::validate ( int  $senderId)

Validates the parsed recipients and set errors accordingly.

See also
\ilMailAddressType::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.

47 : bool
48 {
49 $this->resetErrors();
50
51 return $this->isValid($senderId);
52 }
isValid(int $senderId)

References isValid(), and resetErrors().

+ Here is the call graph for this function:

Field Documentation

◆ $address

◆ $errors

ilBaseMailAddressType::$errors = []
private

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

Referenced by getErrors().

◆ $logger

◆ $typeHelper


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