ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
TableBuilder.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27
29{
30 public function __construct(
31 protected InternalDomainService $domain,
32 protected int $lm_id,
33 protected string $lang,
34 object $parent_gui,
35 string $parent_cmd
36 ) {
37 parent::__construct($parent_gui, $parent_cmd);
38 }
39
40 protected function getId(): string
41 {
42 return "lm_short_title";
43 }
44
45 protected function getTitle(): string
46 {
47 return $this->domain->lng()->txt("cont_short_titles");
48 }
49
50 protected function getRetrieval(): RetrievalInterface
51 {
52 return $this->domain->shortTitlesRetrieval($this->lm_id, $this->lang);
53 }
54
55 protected function transformRow(array $data_row): array
56 {
57 return [
58 "id" => $data_row["id"],
59 "title" => $data_row["title"],
60 "short_title" => $data_row["short_title"]
61 ];
62 }
63
65 {
66 $lng = $this->domain->lng();
67
68 return $table
69 ->textColumn("title", $lng->txt("title"))
70 ->textColumn("short_title", $lng->txt("cont_short_title"))
71 ->singleAction("editShortTitle", $lng->txt("cont_short_title"), true);
72 }
73}
__construct(protected InternalDomainService $domain, protected int $lm_id, protected string $lang, object $parent_gui, string $parent_cmd)
transformRow(array $data_row)
transform raw data array to table row data array
textColumn(string $key, string $title, bool $sortable=false)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $lng
Definition: privfeed.php:26