ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMailGroupAddressType Class Reference
+ Inheritance diagram for ilMailGroupAddressType:
+ Collaboration diagram for ilMailGroupAddressType:

Public Member Functions

 resolve ()
 Returns an array of resolved user ids based on an address instance. More...
 
- Public Member Functions inherited from ilBaseMailAddressType
 __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...
 
 resolve ()
 Returns an array of resolved user ids based on an address instance. More...
 
 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...
 

Protected Member Functions

 isValid (int $sender_id)
 
- Protected Member Functions inherited from ilBaseMailAddressType
 isValid (int $sender_id)
 
 pushError (string $language_variable, array $place_holder_values=[])
 

Detailed Description

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

Member Function Documentation

◆ isValid()

ilMailGroupAddressType::isValid ( int  $sender_id)
protected

Reimplemented from ilBaseMailAddressType.

Definition at line 23 of file class.ilMailGroupAddressType.php.

23 : bool
24 {
25 return $this->type_helper->doesGroupNameExists(substr($this->address->getMailbox(), 1));
26 }

◆ resolve()

ilMailGroupAddressType::resolve ( )

Returns an array of resolved user ids based on an address instance.

Returns
list<int>

Implements ilMailAddressType.

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

28 : array
29 {
30 $usr_ids = [];
31
32 $possible_grp_title = substr($this->address->getMailbox(), 1);
33 $possible_grp_obj_id = $this->type_helper->getGroupObjIdByTitle($possible_grp_title);
34
35 $group = null;
36 foreach ($this->type_helper->getAllRefIdsForObjId($possible_grp_obj_id) as $ref_id) {
37 $group = $this->type_helper->getInstanceByRefId($ref_id);
38 break;
39 }
40
41 if ($group instanceof ilObjGroup) {
42 $usr_ids = $group->getGroupMemberIds();
43
44 $this->logger->debug(sprintf(
45 "Found the following group member user ids for address (object title) '%s' and obj_id %s: %s",
46 $possible_grp_title,
47 $possible_grp_obj_id,
48 implode(', ', array_unique($usr_ids))
49 ));
50 } else {
51 $this->logger->debug(sprintf(
52 "Did not find any group object for address (object title) '%s'",
53 $possible_grp_title
54 ));
55 }
56
57 return array_unique($usr_ids);
58 }
Class ilObjGroup.
$ref_id
Definition: ltiauth.php:66

References $ref_id, and ILIAS\Repository\logger().

+ Here is the call graph for this function:

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