ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 (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...
 

Protected Member Functions

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

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, ILIAS\Repository\logger(), and null.

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  $usrIds = $group->getGroupMemberIds();
47 
48  $this->logger->debug(sprintf(
49  "Found the following group member user ids for address (object title) '%s' and obj_id %s: %s",
50  $possibleGroupTitle,
51  $possibleGroupObjId,
52  implode(', ', array_unique($usrIds))
53  ));
54  } else {
55  $this->logger->debug(sprintf(
56  "Did not find any group object for address (object title) '%s'",
57  $possibleGroupTitle
58  ));
59  }
60 
61  return array_unique($usrIds);
62  }
$refId
Definition: xapitoken.php:58
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class ilObjGroup.
+ Here is the call graph for this function:

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