ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilBaseMailAddressType Class Reference

Class ilBaseMailAddressType. More...

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

Public Member Functions

 __construct (protected ilMailAddressTypeHelper $typeHelper, protected ilMailAddress $address, protected 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=[])
 

Private Member Functions

 resetErrors ()
 

Private Attributes

array $errors = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

References isValid().

34  {
35  }
+ 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 64 of file class.ilBaseMailAddressType.php.

65  {
66  return $this->address;
67  }
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 59 of file class.ilBaseMailAddressType.php.

References $errors.

59  : array
60  {
61  return $this->errors;
62  }

◆ 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
Parameters
string[]$placeHolderValues

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

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

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

◆ resetErrors()

ilBaseMailAddressType::resetErrors ( )
private

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

Referenced by validate().

54  : void
55  {
56  $this->errors = [];
57  }
+ 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 39 of file class.ilBaseMailAddressType.php.

References isValid(), and resetErrors().

Referenced by ilMailAddressTypeFactory\getByPrefix().

39  : bool
40  {
41  $this->resetErrors();
42 
43  return $this->isValid($senderId);
44  }
isValid(int $senderId)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $errors

array ilBaseMailAddressType::$errors = []
private

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

Referenced by getErrors().


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