ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Presentation.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24use ILIAS\UI\Implementation\Component\ComponentHelper;
28use Closure;
30
31class Presentation extends Table implements T\Presentation
32{
33 use ComponentHelper;
36
40 private array $environment = [];
41
42 private array $records = [];
44
45 public function __construct(
46 string $title,
47 array $view_controls,
48 protected Closure $row_mapping,
50 ) {
52 $this->view_controls = $view_controls;
53 $this->signal_toggle_all = $signal_generator->create();
54 }
55
57 {
59 }
60
64 public function withRowMapping(Closure $row_mapping): T\Presentation
65 {
66 $clone = clone $this;
67 $clone->row_mapping = $row_mapping;
68 return $clone;
69 }
70
74 public function getRowMapping(): Closure
75 {
76 return $this->row_mapping;
77 }
78
83 {
84 $clone = clone $this;
85 $clone->environment = $environment;
86 return $clone;
87 }
88
92 public function getEnvironment(): array
93 {
94 return $this->environment;
95 }
96
100 public function withData(array $records): T\Presentation
101 {
102 $clone = clone $this;
103 $clone->records = $records;
104 return $clone;
105 }
106
110 public function getData(): array
111 {
112 return $this->records;
113 }
114
116 {
118 }
119
120 public function getExpandAllSignal(): Signal
121 {
123 $option->addOption('expand', true);
124 return $option;
125 }
126
127 public function getCollapseAllSignal(): Signal
128 {
130 $option->addOption('expand', false);
131 return $option;
132 }
133}
__construct(string $title, array $view_controls, protected Closure $row_mapping, protected SignalGeneratorInterface $signal_generator)
clone(int $target_parent_obj_id)
readonly SignalGenerator $signal_generator
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
trait HasViewControls
Trait for panels supporting view controls.
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.