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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

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

Member Function Documentation

◆ getGroupedCollections()

ilUsersGalleryContacts::getGroupedCollections ( bool  $ignore_myself = false)

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

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

33  : array
34  {
35  global $DIC;
36 
37  $groups = [];
38 
39  foreach ($this->getRelationSequence() as $relations) {
40  $user_data = [];
41 
42  foreach ($relations as $usr_id => $relation) {
43  if (!($user = ilObjectFactory::getInstanceByObjId($usr_id, false)) || !($user instanceof ilObjUser)) {
44  continue;
45  }
46 
47  if (!$user->getActive()) {
48  continue;
49  }
50 
51  if ($ignore_myself && $user->getId() === $DIC->user()->getId()) {
52  continue;
53  }
54 
55  $user_data[$user->getId()] = $user;
56  }
57 
58  $groups[] = $this->getPopulatedGroup($user_data);
59  }
60 
61  return $groups;
62  }
global $DIC
Definition: feed.php:28
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 25 of file class.ilUsersGalleryContacts.php.

References ilBuddyList\getInstanceByGlobalUser().

Referenced by getGroupedCollections().

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

◆ hasRemovableUsers()

ilUsersGalleryContacts::hasRemovableUsers ( )

Implements ilUsersGalleryCollectionProvider.

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

64  : bool
65  {
66  return true;
67  }

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