ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
class.TimelineManager.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29
34{
35 public function __construct(
36 protected InternalDataService $data,
37 protected InternalRepoService $repo,
38 protected InternalDomainService $domain
39 ) {
40 }
41
42 public function getNewsData(
43 int $ref_id,
44 int $context_obj_id,
45 string $context_type,
46 int $period,
47 bool $include_auto_entries,
48 int $items_per_load,
49 array $excluded
51 $criteria = new NewsCriteria(
52 period: $period,
53 limit: $items_per_load,
54 no_auto_generated: !$include_auto_entries,
55 excluded_news_ids: $excluded,
56 read_user_id: $this->domain->user()->getId()
57 );
58
59 if ($ref_id > 0) {
60 return $this->domain->collection()->getNewsForContainer(
61 $ref_id,
62 $context_obj_id,
63 $context_type,
64 $criteria,
65 $this->domain->user()->getId()
66 );
67 } else {
68 return $this->domain->collection()->getNewsForUser(
69 $this->domain->user(),
70 $criteria
71 );
72 }
73 }
74
75 public function getNewsItem(int $news_id): ?NewsItem
76 {
77 return $this->repo->news()->findById($news_id);
78 }
79}
Optimized News Collection with memory-efficient data structures to support large news feeds.
News Criteria DTO for querying news items supports caching, JSON serialization, and validation.
News Item DTO for transfer of news items.
Definition: NewsItem.php:29
Repository internal data service.
getNewsData(int $ref_id, int $context_obj_id, string $context_type, int $period, bool $include_auto_entries, int $items_per_load, array $excluded)
__construct(protected InternalDataService $data, protected InternalRepoService $repo, protected InternalDomainService $domain)
$ref_id
Definition: ltiauth.php:66