19 declare(strict_types=1);
35 $this->globally_activated = ($DIC->settings()->get(
'rep_favourites',
'0') ===
'1');
36 $this->repo = is_null($repo)
44 $this->repo->add($user_id, $ref_id);
51 $this->repo->remove($user_id,
$ref_id);
61 return $this->repo->ifIsFavourite($user_id, $ref_id);
68 public function loadData(
int $user_id, array $ref_ids): void
70 $this->repo->loadData($user_id, $ref_ids);
87 return $this->repo->getFavouritesOfUser($user_id, $a_types);
93 $this->repo->removeFavouritesOfRefId($ref_id);
99 $this->repo->removeFavouritesOfRefId($user_id);
add(int $user_id, int $ref_id)
ifIsFavourite(int $user_id, int $ref_id)
Manages favourites, currently the interface for other components, needs discussion.
loadData(int $user_id, array $ref_ids)
Preloads data into cache.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct(?ilFavouritesDBRepository $repo=null)
removeFavouritesOfUser(int $user_id)
ilFavouritesDBRepository $repo
getFavouritesOfUser(int $user_id, ?array $a_types=null)
Get favourites of user.
removeFavouritesOfRefId(int $ref_id)
static deletePDItemsCache(int $a_usr_id)
Delete cache (add remove desktop item)