ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 implements T\Presentation
12 {
13  use ComponentHelper;
14  use HasViewControls;
15 
19  protected $signal_generator;
20 
24  private $title;
25 
29  private $row_mapping;
30 
34  private $records;
35 
39  private $environment;
40 
41 
42 
44  {
45  $this->checkStringArg("string", $title);
46  $this->title = $title;
47  $this->view_controls = $view_controls;
48  $this->row_mapping = $row_mapping;
49  $this->signal_generator = $signal_generator;
50  }
51 
55  public function getSignalGenerator()
56  {
58  }
59 
63  public function withTitle($title)
64  {
65  $this->checkStringArg("string", $title);
66  $clone = clone $this;
67  $clone->title = $title;
68  ;
69  return $clone;
70  }
71 
75  public function getTitle()
76  {
77  return $this->title;
78  }
79 
84  {
85  $clone = clone $this;
86  $clone->row_mapping = $row_mapping;
87  ;
88  return $clone;
89  }
90 
94  public function getRowMapping()
95  {
96  return $this->row_mapping;
97  }
98 
102  public function withEnvironment(array $environment)
103  {
104  $clone = clone $this;
105  $clone->environment = $environment;
106  return $clone;
107  }
108 
112  public function getEnvironment()
113  {
114  return $this->environment;
115  }
116 
120  public function withData(array $records)
121  {
122  $clone = clone $this;
123  $clone->records = $records;
124  ;
125  return $clone;
126  }
127 
131  public function getData()
132  {
133  return $this->records;
134  }
135 }
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)
withTitle($title)
Get a table like this with title $title.
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...
getTitle()
Get the title of the table.string
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.