ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMailGroupAddressType Class Reference

Class ilMailGroupAddressType. More...

+ Inheritance diagram for ilMailGroupAddressType:
+ Collaboration diagram for ilMailGroupAddressType:

Public Member Functions

 isValid ($a_sender_id)
 {
Parameters
$a_sender_idinteger
Returns
boolean
} More...
 
 resolve ()
 {Returns an array of resolved user ids.
Returns
int[]
} More...
 
- Public Member Functions inherited from ilBaseMailAddressType
 __construct (\ilMailAddress $a_address)
 ilBaseMailAddressType constructor. More...
 
 validate ($a_sender_id)
 {
Parameters
$a_sender_idinteger
Returns
bool
} More...
 
 getErrors ()
 
 resolve ()
 Returns an array of resolved user ids. More...
 
 validate ($a_sender_id)
 

Additional Inherited Members

- Protected Member Functions inherited from ilBaseMailAddressType
 init ()
 
 isValid ($a_sender_id)
 
- Protected Attributes inherited from ilBaseMailAddressType
 $address
 
 $rbacsystem
 
 $rbacreview
 
 $errors = array()
 

Detailed Description

Member Function Documentation

◆ isValid()

ilMailGroupAddressType::isValid (   $a_sender_id)

{

Parameters
$a_sender_idinteger
Returns
boolean
}

Reimplemented from ilBaseMailAddressType.

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

17 {
18 return ilUtil::groupNameExists(substr($this->address->getMailbox(), 1));
19 }
static groupNameExists($a_group_name, $a_id=0)
checks if group name already exists.

References ilUtil\groupNameExists().

+ Here is the call graph for this function:

◆ resolve()

ilMailGroupAddressType::resolve ( )

{Returns an array of resolved user ids.

Returns
int[]
}

Implements ilMailAddressType.

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

25 {
26 $usr_ids = array();
27
28 $possibleGroupTitle = substr($this->address->getMailbox(), 1);
29 $possibleGroupObjId = ilObjGroup::_lookupIdByTitle($possibleGroupTitle);
30
31 $grp_object = null;
32 foreach (ilObject::_getAllReferences($possibleGroupObjId) as $ref_id) {
33 $grp_object = ilObjectFactory::getInstanceByRefId($ref_id);
34 break;
35 }
36
37 if ($grp_object instanceof ilObjGroup) {
38 foreach ($grp_object->getGroupMemberIds() as $usr_id) {
39 $usr_ids[] = $usr_id;
40 }
41
43 "Found the following group member user ids for address (object title) '%s' and obj_id %s: %s",
44 $possibleGroupTitle,
45 $possibleGroupObjId,
46 implode(', ', array_unique($usr_ids))
47 ));
48 } else {
50 "Did not find any group object for address (object title) '%s'",
51 $possibleGroupTitle
52 ));
53 }
54
55 return array_unique($usr_ids);
56 }
sprintf('%.4f', $callTime)
static getLogger($a_component_id)
Get component logger.
Class ilObjGroup.
static _lookupIdByTitle($a_title)
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static _getAllReferences($a_id)
get all reference ids of object

References ilObject\_getAllReferences(), ilObjGroup\_lookupIdByTitle(), ilObjectFactory\getInstanceByRefId(), ilLoggerFactory\getLogger(), and sprintf.

+ Here is the call graph for this function:

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