ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMailGroupAddressType Class Reference

Class ilMailGroupAddressType. More...

+ 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 (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...
 

Protected Member Functions

 isValid (int $senderId)
 
- Protected Member Functions inherited from ilBaseMailAddressType
 isValid (int $senderId)
 
 pushError (string $languageVariable, array $placeHolderValues=[])
 

Additional Inherited Members

- Protected Attributes inherited from ilBaseMailAddressType
ilMailAddressTypeHelper $typeHelper
 
ilMailAddress $address
 
ilLogger $logger
 

Detailed Description

Member Function Documentation

◆ isValid()

ilMailGroupAddressType::isValid ( int  $senderId)
protected

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

27  : bool
28  {
29  return $this->typeHelper->doesGroupNameExists(substr($this->address->getMailbox(), 1));
30  }

◆ resolve()

ilMailGroupAddressType::resolve ( )

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

Returns
int[]

Implements ilMailAddressType.

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

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

32  : array
33  {
34  $usrIds = [];
35 
36  $possibleGroupTitle = substr($this->address->getMailbox(), 1);
37  $possibleGroupObjId = $this->typeHelper->getGroupObjIdByTitle($possibleGroupTitle);
38 
39  $group = null;
40  foreach ($this->typeHelper->getAllRefIdsForObjId($possibleGroupObjId) as $refId) {
41  $group = $this->typeHelper->getInstanceByRefId($refId);
42  break;
43  }
44 
45  if ($group instanceof ilObjGroup) {
46  foreach ($group->getGroupMemberIds() as $usr_id) {
47  $usrIds[] = $usr_id;
48  }
49 
50  $this->logger->debug(sprintf(
51  "Found the following group member user ids for address (object title) '%s' and obj_id %s: %s",
52  $possibleGroupTitle,
53  $possibleGroupObjId,
54  implode(', ', array_unique($usrIds))
55  ));
56  } else {
57  $this->logger->debug(sprintf(
58  "Did not find any group object for address (object title) '%s'",
59  $possibleGroupTitle
60  ));
61  }
62 
63  return array_unique($usrIds);
64  }
$refId
Definition: xapitoken.php:58
Class ilObjGroup.
+ Here is the call graph for this function:

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