ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ilBaseMailAddressType Class Reference
+ Inheritance diagram for ilBaseMailAddressType:
+ Collaboration diagram for ilBaseMailAddressType:

Public Member Functions

 __construct (protected ilMailAddressTypeHelper $type_helper, protected ilMailAddress $address, protected ilLogger $logger)
 
 validate (int $sender_id)
 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 $sender_id)
 
 pushError (string $language_variable, array $place_holder_values=[])
 

Private Member Functions

 resetErrors ()
 

Private Attributes

array $errors = []
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References isValid().

30  {
31  }
+ 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 60 of file class.ilBaseMailAddressType.php.

61  {
62  return $this->address;
63  }

◆ getErrors()

ilBaseMailAddressType::getErrors ( )

Returns a list of errors determined in the validation process.

The errors should be reset everytime the validation is triggered.

Returns
list<ilMailError>
See also
ilMailAddressType::validate

Implements ilMailAddressType.

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

References $errors.

55  : array
56  {
57  return $this->errors;
58  }

◆ isValid()

ilBaseMailAddressType::isValid ( int  $sender_id)
abstractprotected

Referenced by __construct(), and validate().

+ Here is the caller graph for this function:

◆ pushError()

ilBaseMailAddressType::pushError ( string  $language_variable,
array  $place_holder_values = [] 
)
protected
Parameters
list<string>$place_holder_values

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

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

45  : void
46  {
47  $this->errors[] = new ilMailError($language_variable, $place_holder_values);
48  }
+ Here is the caller graph for this function:

◆ resetErrors()

ilBaseMailAddressType::resetErrors ( )
private

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

Referenced by validate().

50  : void
51  {
52  $this->errors = [];
53  }
+ Here is the caller graph for this function:

◆ validate()

ilBaseMailAddressType::validate ( int  $sender_id)

Validates the parsed recipients and set errors accordingly.

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

Implements ilMailAddressType.

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

References isValid(), and resetErrors().

Referenced by ilMailAddressTypeFactory\getByPrefix().

35  : bool
36  {
37  $this->resetErrors();
38 
39  return $this->isValid($sender_id);
40  }
isValid(int $sender_id)
+ 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 24 of file class.ilBaseMailAddressType.php.

Referenced by getErrors().


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