19declare(strict_types=1);
32 $this->
access = $DIC->access();
36 public function getItems(array $object_type_white_list = []): array
38 $short_desc = $this->
settings->get(
'rep_shorten_description');
39 $short_desc_max_length = (
int) $this->
settings->get(
'rep_shorten_description_length');
41 $favourites = $this->fav_manager->getFavouritesOfUser(
42 $this->actor->getId(),
43 count($object_type_white_list) > 0 ? $object_type_white_list : null
45 $access_granted_favourites = [];
46 foreach ($favourites as $idx => $favourite) {
47 if (!$this->
access->checkAccess(
'visible',
'', $favourite[
'ref_id'])) {
51 if ($short_desc && $short_desc_max_length !== 0) {
55 $access_granted_favourites[$idx] = $favourite;
57 return $access_granted_favourites;
Manages favourites, currently the interface for other components, needs discussion.
readonly ilSetting $settings
__construct(protected readonly ilObjUser $actor)
getItems(array $object_type_white_list=[])
readonly ilAccessHandler $access
readonly ilFavouritesManager $fav_manager
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...