ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilUsersGalleryContacts Class Reference
+ Inheritance diagram for ilUsersGalleryContacts:
+ Collaboration diagram for ilUsersGalleryContacts:

Public Member Functions

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

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.

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
User class.
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
global $DIC
Definition: shib_login.php:26

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

+ 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.

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)

References ilBuddyList\getInstanceByGlobalUser().

Referenced by getGroupedCollections().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasRemovableUsers()

ilUsersGalleryContacts::hasRemovableUsers ( )

Reimplemented from ilAbstractUsersGalleryCollectionProvider.

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: