ILIAS
trunk Revision v12.0_alpha-1540-g00f839d5fa1
◀ ilDoc Overview
class.TimelineManager.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\News\Timeline
;
22
23
use
ILIAS\News\Data\NewsCollection
;
24
use
ILIAS\News\Data\NewsContext
;
25
use
ILIAS\News\Data\NewsCriteria
;
26
use
ILIAS\News\Data\NewsItem
;
27
use
ILIAS\News\InternalRepoService
;
28
use
ILIAS\News\InternalDataService
;
29
use
ILIAS\News\InternalDomainService
;
30
34
class
TimelineManager
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
51
):
NewsCollection
{
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
}
ILIAS\News\Data\NewsCollection
Optimized News Collection with memory-efficient data structures to support large news feeds.
Definition:
NewsCollection.php:30
ILIAS\News\Data\NewsContext
News Context DTO represents a context where news items can be associated with.
Definition:
NewsContext.php:29
ILIAS\News\Data\NewsCriteria
News Criteria DTO for querying news items supports caching, JSON serialization, and validation.
Definition:
NewsCriteria.php:29
ILIAS\News\Data\NewsItem
News Item DTO for transfer of news items.
Definition:
NewsItem.php:29
ILIAS\News\InternalDataService
Repository internal data service.
Definition:
class.InternalDataService.php:30
ILIAS\News\InternalDomainService
Definition:
class.InternalDomainService.php:34
ILIAS\News\InternalRepoService
Notes internal repo service.
Definition:
class.InternalRepoService.php:32
ILIAS\News\Timeline\TimelineManager
Definition:
class.TimelineManager.php:35
ILIAS\News\Timeline\TimelineManager\getNewsData
getNewsData(int $ref_id, int $context_obj_id, string $context_type, int $period, bool $include_auto_entries, int $items_per_load, array $excluded)
Definition:
class.TimelineManager.php:43
ILIAS\News\Timeline\TimelineManager\__construct
__construct(protected InternalDataService $data, protected InternalRepoService $repo, protected InternalDomainService $domain)
Definition:
class.TimelineManager.php:36
ILIAS\News\Timeline\TimelineManager\getNewsItem
getNewsItem(int $news_id)
Definition:
class.TimelineManager.php:74
$ref_id
$ref_id
Definition:
ltiauth.php:66
$data
$data
Definition:
ltiregistration.php:29
ILIAS\News\Timeline
Definition:
class.TimelineManager.php:21
ILIAS\Repository\user
user()
Definition:
trait.GlobalDICDomainServices.php:66
ILIAS\Survey\Mode\getId
getId()
Definition:
trait.ModeProviderBase.php:35
components
ILIAS
News
Timeline
class.TimelineManager.php
Generated on Wed Jun 3 2026 23:05:33 for ILIAS by
1.9.4 (using
Doxyfile
)