ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
Presentation.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 2017 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3 
5 
10 
11 class Presentation extends Table implements T\Presentation
12 {
13  use ComponentHelper;
14  use HasViewControls;
15 
19  protected $signal_generator;
20 
24  private $row_mapping;
25 
29  private $records;
30 
34  private $environment;
35 
36 
37 
39  {
40  $this->checkStringArg("string", $title);
41  $this->title = $title;
42  $this->view_controls = $view_controls;
43  $this->row_mapping = $row_mapping;
44  $this->signal_generator = $signal_generator;
45  }
46 
50  public function getSignalGenerator()
51  {
53  }
54 
59  {
60  $clone = clone $this;
61  $clone->row_mapping = $row_mapping;
62  return $clone;
63  }
64 
68  public function getRowMapping()
69  {
70  return $this->row_mapping;
71  }
72 
76  public function withEnvironment(array $environment)
77  {
78  $clone = clone $this;
79  $clone->environment = $environment;
80  return $clone;
81  }
82 
86  public function getEnvironment()
87  {
88  return $this->environment;
89  }
90 
94  public function withData(array $records)
95  {
96  $clone = clone $this;
97  $clone->records = $records;
98  return $clone;
99  }
100 
104  public function getData()
105  {
106  return $this->records;
107  }
108 }
trait ComponentHelper
Provides common functionality for component implementations.
checkStringArg($which, $value)
Throw an InvalidArgumentException if $value is no string.
withRowMapping(\Closure $row_mapping)
Get a table like this with the closure $row_mapping.This closure is called by the renderer upon build...
trait HasViewControls
Trait for panels supporting view controls.
__construct($title, array $view_controls, \Closure $row_mapping, SignalGeneratorInterface $signal_generator)
withData(array $records)
Fill a recordset into the table.All elements in $records MUST be processable by the mapping-closure...
getData()
Get the recordset of this table.All elements in $records MUST be processable by the mapping-closure...
This describes a Presentation Table.
withEnvironment(array $environment)
Add a list of additional things the mapping-closure needs for processing.These can be virtually anyth...
getEnvironment()
Get an array of additionally needed elements to build a data-entry.array<string,mixed> ...
getRowMapping()
Get the closure to construct row-entries with.