ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
SubitemPropertiesReader.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25use ILIAS\Data\Factory as DataFactory;
26use ilLanguage;
29use Generator;
30use ilObjForum;
32
34{
35 protected ilLanguage $lng;
36 protected DataFactory $data_factory;
38
39 public static function type(): string
40 {
41 return 'frm';
42 }
43
44 public function init(Container $dic): void
45 {
46 $this->lng = $dic->language();
47 $this->data_factory = new DataFactory();
48 $this->static_url = $dic['static_url'];
49 }
50
51 public function getSubitemProperties(
52 PropertiesFactory $factory,
53 int $parent_ref_id,
54 ID ...$subitem_ids
55 ): Generator {
56 foreach ($subitem_ids as $subitem_id) {
57 $link = $this->static_url->builder()->build(
58 'frm',
59 $this->data_factory->refId($parent_ref_id),
60 [$subitem_id->id()]
61 );
62 yield $factory->get(
63 $subitem_id,
64 ilObjForum::_lookupThreadSubject((int) $subitem_id->id()),
65 $link,
66 false,
67 $this->lng->txt('thread')
68 );
69 }
70 }
71}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
language()
Get interface to the i18n service.
Definition: Container.php:95
Builds data types.
Definition: Factory.php:36
getSubitemProperties(PropertiesFactory $factory, int $parent_ref_id, ID ... $subitem_ids)
Order of the output should respect the order of the subitem_ids.
Class Services.
Definition: Services.php:38
language handling
Class ilObjForum.
static _lookupThreadSubject(int $a_thread_id)
get(ID $id, string $title, ?URI $link_to_subitem, bool $open_link_in_new_viewport, string $presentable_subitem_type)
$dic
Definition: ltiresult.php:33