ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
class.TimelineManager.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
30
35{
36 public function __construct(
37 protected InternalDataService $data,
38 protected InternalRepoService $repo,
39 protected InternalDomainService $domain
40 ) {
41 }
42
43 public function getNewsData(
44 int $ref_id,
45 int $context_obj_id,
46 string $context_type,
47 int $period,
48 bool $include_auto_entries,
49 int $items_per_load,
50 array $excluded
52 $criteria = new NewsCriteria(
53 period: $period,
54 limit: $items_per_load,
55 no_auto_generated: !$include_auto_entries,
56 excluded_news_ids: $excluded,
57 read_user_id: $this->domain->user()->getId()
58 );
59
60 if ($ref_id > 0) {
61 return $this->domain->collection()->getNewsForContext(
62 new NewsContext($ref_id, $context_obj_id, $context_type),
63 $criteria,
64 $this->domain->user()->getId()
65 );
66 } else {
67 return $this->domain->collection()->getNewsForUser(
68 $this->domain->user(),
69 $criteria
70 );
71 }
72 }
73
74 public function getNewsItem(int $news_id): ?NewsItem
75 {
76 return $this->repo->news()->findById($news_id);
77 }
78}
Optimized News Collection with memory-efficient data structures to support large news feeds.
News Context DTO represents a context where news items can be associated with.
Definition: NewsContext.php:29
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