ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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.
Returns
int[]
More...
 
- Public Member Functions inherited from ilBaseMailAddressType
 __construct (ilMailAddressTypeHelper $typeHelper, ilMailAddress $address, ilLogger $logger)
 ilBaseMailAddressType constructor. More...
 
 validate (int $senderId)
 Validates the parsed recipients and set errors accordingly.
Parameters
$senderIdinteger The id of the acting ILIAS user, can be used for permission checks etc.
Returns
bool
See also
ilMailAddressType::getErrors
More...
 
 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
More...
 
 getAddress ()
 The address instance used for validation and user id lookup.
Returns
ilMailAddress
More...
 
 resolve ()
 Returns an array of resolved user ids based on an address instance. More...
 
 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)
 
Parameters
$senderIdinteger
Returns
bool
More...
 
- Protected Member Functions inherited from ilBaseMailAddressType
 isValid (int $senderId)
 
 pushError (string $languageVariable, array $placeHolderValues=[])
 

Additional Inherited Members

- Protected Attributes inherited from ilBaseMailAddressType
 $typeHelper
 
 $address
 
 $logger
 

Detailed Description

Member Function Documentation

◆ isValid()

ilMailGroupAddressType::isValid ( int  $senderId)
protected

Parameters
$senderIdinteger
Returns
bool

Reimplemented from ilBaseMailAddressType.

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

13 : bool
14 {
15 return $this->typeHelper->doesGroupNameExists(substr($this->address->getMailbox(), 1));
16 }

◆ resolve()

ilMailGroupAddressType::resolve ( )

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

Returns
int[]

Implements ilMailAddressType.

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

21 : array
22 {
23 $usrIds = [];
24
25 $possibleGroupTitle = substr($this->address->getMailbox(), 1);
26 $possibleGroupObjId = $this->typeHelper->getGroupObjIdByTitle($possibleGroupTitle);
27
28 $group = null;
29 foreach ($this->typeHelper->getAllRefIdsForObjId($possibleGroupObjId) as $refId) {
30 $group = $this->typeHelper->getInstanceByRefId($refId);
31 break;
32 }
33
34 if ($group instanceof ilObjGroup) {
35 foreach ($group->getGroupMemberIds() as $usr_id) {
36 $usrIds[] = $usr_id;
37 }
38
39 $this->logger->debug(sprintf(
40 "Found the following group member user ids for address (object title) '%s' and obj_id %s: %s",
41 $possibleGroupTitle,
42 $possibleGroupObjId,
43 implode(', ', array_unique($usrIds))
44 ));
45 } else {
46 $this->logger->debug(sprintf(
47 "Did not find any group object for address (object title) '%s'",
48 $possibleGroupTitle
49 ));
50 }
51
52 return array_unique($usrIds);
53 }
Class ilObjGroup.
$refId
Definition: xapitoken.php:42

References $refId.


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