ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 

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.

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

37  {
38  $this->address = $address;
39  $this->typeHelper = $typeHelper;
40  $this->logger = $logger;
41  }
ilMailAddressTypeHelper $typeHelper
+ 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.

References $address.

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

Returns
ilMailError[]
See also
ilMailAddressType::validate

Implements ilMailAddressType.

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

References $errors.

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

◆ isValid()

ilBaseMailAddressType::isValid ( int  $senderId)
abstractprotected

Referenced by __construct(), and 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.

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

52  : void
53  {
54  $this->errors[] = new ilMailError($languageVariable, $placeHolderValues);
55  }
Class ilMailError.
+ Here is the caller graph for this function:

◆ resetErrors()

ilBaseMailAddressType::resetErrors ( )
private

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

Referenced by validate().

57  : void
58  {
59  $this->errors = [];
60  }
+ 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.

References isValid(), and resetErrors().

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

Field Documentation

◆ $address

ilMailAddress ilBaseMailAddressType::$address
protected

◆ $errors

array ilBaseMailAddressType::$errors = []
private

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

Referenced by getErrors().

◆ $logger

ilLogger ilBaseMailAddressType::$logger
protected

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

Referenced by __construct().

◆ $typeHelper

ilMailAddressTypeHelper ilBaseMailAddressType::$typeHelper
protected

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

Referenced by __construct().


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