ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilUsersGalleryContacts Class Reference
+ Inheritance diagram for ilUsersGalleryContacts:
+ Collaboration diagram for ilUsersGalleryContacts:

Public Member Functions

 getGroupedCollections (bool $ignore_myself=false)
 
 hasRemovableUsers ()
 
- Public Member Functions inherited from ilAbstractUsersGalleryCollectionProvider
 hasRemovableUsers ()
 
- Public Member Functions inherited from ilUsersGalleryCollectionProvider
 getGroupedCollections ()
 

Protected Member Functions

 getRelationSequence ()
 
- Protected Member Functions inherited from ilAbstractUsersGalleryCollectionProvider
 getPopulatedGroup (array $users)
 

Detailed Description

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

Member Function Documentation

◆ getGroupedCollections()

ilUsersGalleryContacts::getGroupedCollections ( bool  $ignore_myself = false)

Definition at line 34 of file class.ilUsersGalleryContacts.php.

References $DIC, $relation, ilObjectFactory\getInstanceByObjId(), ilAbstractUsersGalleryCollectionProvider\getPopulatedGroup(), and getRelationSequence().

34  : array
35  {
36  global $DIC;
37 
38  $groups = [];
39 
40  foreach ($this->getRelationSequence() as $relations) {
41  $user_data = [];
42 
43  foreach ($relations as $usr_id => $relation) {
44  if (!($user = ilObjectFactory::getInstanceByObjId($usr_id, false)) || !($user instanceof ilObjUser)) {
45  continue;
46  }
47 
48  if (!$user->getActive()) {
49  continue;
50  }
51 
52  if ($ignore_myself && $user->getId() === $DIC->user()->getId()) {
53  continue;
54  }
55 
56  $user_data[$user->getId()] = $user;
57  }
58 
59  $groups[] = $this->getPopulatedGroup($user_data);
60  }
61 
62  return $groups;
63  }
$relation
global $DIC
Definition: shib_login.php:22
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
+ Here is the call graph for this function:

◆ getRelationSequence()

ilUsersGalleryContacts::getRelationSequence ( )
protected
Returns
Generator<array<int, ilBuddySystemRelation>>

Definition at line 26 of file class.ilUsersGalleryContacts.php.

References ilBuddyList\getInstanceByGlobalUser().

Referenced by getGroupedCollections().

26  : Generator
27  {
28  yield ilBuddyList::getInstanceByGlobalUser()->getRequestRelationsForOwner()->toArray();
29  yield ilBuddyList::getInstanceByGlobalUser()->getLinkedRelations()->toArray();
30  yield ilBuddyList::getInstanceByGlobalUser()->getRequestRelationsByOwner()->toArray() + ilBuddyList::getInstanceByGlobalUser()->getIgnoredRelationsByOwner()->toArray();
31  yield ilBuddyList::getInstanceByGlobalUser()->getIgnoredRelationsForOwner()->toArray();
32  }
static getInstanceByGlobalUser(?ilObjUser $user=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasRemovableUsers()

ilUsersGalleryContacts::hasRemovableUsers ( )

Implements ilUsersGalleryCollectionProvider.

Definition at line 65 of file class.ilUsersGalleryContacts.php.

65  : bool
66  {
67  return true;
68  }

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