39 $this->repo = (is_null($repo))
43 $this->rbacreview = (is_null($rbacreview))
44 ? $DIC->rbac()->review()
47 $this->fav_manager = (is_null($fav_manager))
51 $this->
access = $DIC->access();
56 $this->repo->addRoleRecommendation($role_id, $ref_id);
61 $this->repo->removeRoleRecommendation($role_id, $ref_id);
69 return $this->repo->getRecommendationsOfRoles([$role_id]);
75 $this->repo->addObjectRecommendation($user_id, $ref_id);
80 $this->repo->removeObjectRecommendation($user_id, $ref_id);
86 $this->repo->removeRecommendationsOfRefId($ref_id);
91 $this->repo->removeRecommendationsOfUser($user_id);
96 $this->repo->removeRecommendationsOfRole($role_id);
108 $role_ids = $review->assignedRoles($user_id);
113 $favourites = $this->fav_manager->getFavouritesOfUser($user_id);
114 $favourites_ref_ids = array_column($favourites,
"ref_id");
116 return array_filter($recommendations,
static function ($i) use ($favourites_ref_ids, $access):
bool {
117 return !in_array($i, $favourites_ref_ids) && $access->
checkAccess(
'visible',
'', $i);
123 $this->repo->declineObjectRecommendation($user_id, $ref_id);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
removeRoleRecommendation(int $role_id, int $ref_id)
removeRecommendationsOfUser(int $user_id)
__construct(?ilRecommendedContentDBRepository $repo=null, ?ilRbacReview $rbacreview=null, ?ilFavouritesManager $fav_manager=null)
getOpenRecommendationsOfUser(int $user_id, array $role_ids)
Open recommendations of user (by role or object, without declined ones)
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance) ...
addObjectRecommendation(int $user_id, int $ref_id)
getRecommendationsOfRole(int $role_id)
Manages favourites, currently the interface for other components, needs discussion.
addRoleRecommendation(int $role_id, int $ref_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
ilRecommendedContentDBRepository $repo
removeRecommendationsOfRole(int $role_id)
ilFavouritesManager $fav_manager
removeObjectRecommendation(int $user_id, int $ref_id)
declineObjectRecommendation(int $user_id, int $ref_id)
getOpenRecommendationsOfUser(int $user_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
removeRecommendationsOfRefId(int $ref_id)