38 $this->repo = (is_null(
$repo))
43 ? $DIC->rbac()->review()
58 $this->repo->addRoleRecommendation($role_id, $ref_id);
68 $this->repo->removeRoleRecommendation($role_id, $ref_id);
78 return $this->repo->getRecommendationsOfRoles([$role_id]);
89 $this->repo->addObjectRecommendation($user_id, $ref_id);
99 $this->repo->removeObjectRecommendation($user_id, $ref_id);
109 $this->repo->removeRecommendationsOfRefId($ref_id);
119 $this->repo->removeRecommendationsOfUser($user_id);
129 $this->repo->removeRecommendationsOfRole($role_id);
143 $role_ids = $review->assignedRoles($user_id);
145 $recommendations =
$repo->getOpenRecommendationsOfUser($user_id, $role_ids);
148 $favourites = $this->fav_manager->getFavouritesOfUser($user_id);
149 $favourites_ref_ids = array_column($favourites,
"ref_id");
151 return array_filter($recommendations,
function (
$i) use ($favourites_ref_ids) {
152 return !in_array(
$i, $favourites_ref_ids);
164 $this->repo->declineObjectRecommendation($user_id, $ref_id);
Recommended content db repository.
removeRoleRecommendation(int $role_id, int $ref_id)
Remove role recommendation.
removeRecommendationsOfUser(int $user_id)
Remove all recommendations of a user.
__construct(ilRecommendedContentDBRepository $repo=null, ilRbacReview $rbacreview=null, ilFavouritesManager $fav_manager=null)
Constructor.
addObjectRecommendation(int $user_id, int $ref_id)
Add object recommendation.
getRecommendationsOfRole(int $role_id)
Add role recommendation.
Manages favourites, currently the interface for other components, needs discussion.
addRoleRecommendation(int $role_id, int $ref_id)
Add role recommendation.
removeRecommendationsOfRole(int $role_id)
Remove all recommendations of a role.
removeObjectRecommendation(int $user_id, int $ref_id)
Remove object recommendation.
declineObjectRecommendation(int $user_id, int $ref_id)
Decline object recommendation.
getOpenRecommendationsOfUser(int $user_id)
Get open recommendations for user.
Recommended content manager (business logic)
removeRecommendationsOfRefId(int $ref_id)
Remove all recommendations of a ref id (role and user/object related)
class ilRbacReview Contains Review functions of core Rbac.