ILIAS  release_8 Revision v8.24
ilBaseMailAddressType Class Reference

Class ilBaseMailAddressType. More...

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

Public Member Functions

 __construct (ilMailAddressTypeHelper $typeHelper, ilMailAddress $address, ilLogger $logger)
 
 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...
 
- 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

ilMailAddressTypeHelper $typeHelper
 
ilMailAddress $address
 
ilLogger $logger
 

Private Member Functions

 resetErrors ()
 

Private Attributes

array $errors = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

37 {
38 $this->address = $address;
39 $this->typeHelper = $typeHelper;
40 $this->logger = $logger;
41 }
ilMailAddressTypeHelper $typeHelper

References $address, $logger, $typeHelper, and ILIAS\Repository\logger().

+ Here is the call graph for this function:

Member Function Documentation

◆ getAddress()

ilBaseMailAddressType::getAddress ( )

The address instance used for validation and user id lookup.

Implements ilMailAddressType.

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

68 {
69 return $this->address;
70 }
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.

Returns
ilMailError[]
See also
ilMailAddressType::validate

Implements ilMailAddressType.

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

62 : array
63 {
64 return $this->errors;
65 }

References $errors.

◆ isValid()

ilBaseMailAddressType::isValid ( int  $senderId)
abstractprotected

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

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

52 : void
53 {
54 $this->errors[] = new ilMailError($languageVariable, $placeHolderValues);
55 }
Class ilMailError.

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

+ Here is the caller graph for this function:

◆ resetErrors()

ilBaseMailAddressType::resetErrors ( )
private

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

57 : void
58 {
59 $this->errors = [];
60 }

Referenced by validate().

+ Here is the caller graph for this function:

◆ validate()

ilBaseMailAddressType::validate ( int  $senderId)

Validates the parsed recipients and set errors accordingly.

Parameters
int$senderIdThe id of the acting ILIAS user, can be used for permission checks etc.
See also
ilMailAddressType::getErrors

Implements ilMailAddressType.

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

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

References isValid(), and resetErrors().

+ Here is the call graph for this function:

Field Documentation

◆ $address

◆ $errors

array ilBaseMailAddressType::$errors = []
private

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

Referenced by getErrors().

◆ $logger

◆ $typeHelper


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