ILIAS  trunk Revision v5.2.0beta1-34115-g3a2438be29
ILIAS\UI\Implementation\Component\Table\Presentation Class Reference
+ Inheritance diagram for ILIAS\UI\Implementation\Component\Table\Presentation:
+ Collaboration diagram for ILIAS\UI\Implementation\Component\Table\Presentation:

Public Member Functions

 __construct (string $title, array $view_controls, protected Closure $row_mapping, protected SignalGeneratorInterface $signal_generator)
 
 getSignalGenerator ()
 
 withRowMapping (Closure $row_mapping)
 Get a table like this with the closure $row_mapping.This closure is called by the renderer upon building a row from a record. The renderer will call the closure with these parameters:$row An instance of Component; fill the mutator according to your needs and the structure of your record. $record An element of the table's data. This is the actually variable part when rendering rows. $ui_factory You might, e.g., want a descriptive listing or and image within the content of the row. Use the UI-Factory to build it. $environment When you need auxiliary classes or functions to properly render the data, this is the place to put it.In short: The closure MUST accept the following parameter $row mixed $record $ui_factory mixed $environment The closure MUST return More...
 
 getRowMapping ()
 Get the closure to construct row-entries with. More...
 
 withEnvironment (array $environment)
 Add a list of additional things the mapping-closure needs for processing.These can be virtually anything.
Parameters
array<string,mixed>$environment
More...
 
 getEnvironment ()
 Get an array of additionally needed elements to build a data-entry.
Returns
array<string,mixed>
More...
 
 withData (array $records)
 Fill a recordset into the table.All elements in $records MUST be processable by the mapping-closure.
Parameters
array<mixed>$records
More...
 
 getData ()
 Get the recordset of this table.All elements in $records MUST be processable by the mapping-closure.
Returns
array<mixed>
More...
 
 getExpandCollapseAllSignal ()
 
- Public Member Functions inherited from ILIAS\UI\Implementation\Component\Table\Table
 __construct (protected string $title)
 
 withTitle (string $title)
 
 getTitle ()
 
- Public Member Functions inherited from ILIAS\UI\Component\Component
 getCanonicalName ()
 Get the canonical name of the component. More...
 
- Public Member Functions inherited from ILIAS\UI\Component\ViewControl\HasViewControls
 withViewControls (array $view_controls)
 Add View Controls. More...
 
 getViewControls ()
 Get View Controls. More...
 
- Public Member Functions inherited from ILIAS\UI\Component\JavaScriptBindable
 withOnLoadCode (Closure $binder)
 
 withAdditionalOnLoadCode (Closure $binder)
 Add some onload-code to the component instead of replacing the existing one. More...
 
 getOnLoadCode ()
 Get the currently bound on load code. More...
 

Protected Attributes

Signal $signal_toggle_all
 

Private Attributes

array $environment = []
 
array $records = []
 

Detailed Description

Definition at line 31 of file Presentation.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\UI\Implementation\Component\Table\Presentation::__construct ( string  $title,
array  $view_controls,
protected Closure  $row_mapping,
protected SignalGeneratorInterface  $signal_generator 
)

Definition at line 45 of file Presentation.php.

References ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\UI\Implementation\Component\SignalGeneratorInterface\create().

50  {
51  parent::__construct($title);
52  $this->view_controls = $view_controls;
53  $this->signal_toggle_all = $signal_generator->create();
54  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getData()

ILIAS\UI\Implementation\Component\Table\Presentation::getData ( )

Get the recordset of this table.All elements in $records MUST be processable by the mapping-closure.

Returns
array<mixed>

Implements ILIAS\UI\Component\Table\Presentation.

Definition at line 110 of file Presentation.php.

References ILIAS\UI\Implementation\Component\Table\Presentation\$records.

110  : array
111  {
112  return $this->records;
113  }

◆ getEnvironment()

ILIAS\UI\Implementation\Component\Table\Presentation::getEnvironment ( )

Get an array of additionally needed elements to build a data-entry.

Returns
array<string,mixed>

Implements ILIAS\UI\Component\Table\Presentation.

Definition at line 92 of file Presentation.php.

References ILIAS\UI\Implementation\Component\Table\Presentation\$environment.

92  : array
93  {
94  return $this->environment;
95  }

◆ getExpandCollapseAllSignal()

ILIAS\UI\Implementation\Component\Table\Presentation::getExpandCollapseAllSignal ( )

◆ getRowMapping()

ILIAS\UI\Implementation\Component\Table\Presentation::getRowMapping ( )

Get the closure to construct row-entries with.

Implements ILIAS\UI\Component\Table\Presentation.

Definition at line 74 of file Presentation.php.

74  : Closure
75  {
76  return $this->row_mapping;
77  }

◆ getSignalGenerator()

ILIAS\UI\Implementation\Component\Table\Presentation::getSignalGenerator ( )

Definition at line 56 of file Presentation.php.

56  : SignalGeneratorInterface
57  {
58  return $this->signal_generator;
59  }

◆ withData()

ILIAS\UI\Implementation\Component\Table\Presentation::withData ( array  $records)

Fill a recordset into the table.All elements in $records MUST be processable by the mapping-closure.

Parameters
array<mixed>$records

Implements ILIAS\UI\Component\Table\Presentation.

Definition at line 100 of file Presentation.php.

References ILIAS\UI\Implementation\Component\Table\Presentation\$records.

100  : T\Presentation
101  {
102  $clone = clone $this;
103  $clone->records = $records;
104  return $clone;
105  }

◆ withEnvironment()

ILIAS\UI\Implementation\Component\Table\Presentation::withEnvironment ( array  $environment)

Add a list of additional things the mapping-closure needs for processing.These can be virtually anything.

Parameters
array<string,mixed>$environment

Implements ILIAS\UI\Component\Table\Presentation.

Definition at line 82 of file Presentation.php.

References ILIAS\UI\Implementation\Component\Table\Presentation\$environment.

82  : T\Presentation
83  {
84  $clone = clone $this;
85  $clone->environment = $environment;
86  return $clone;
87  }

◆ withRowMapping()

ILIAS\UI\Implementation\Component\Table\Presentation::withRowMapping ( Closure  $row_mapping)

Get a table like this with the closure $row_mapping.This closure is called by the renderer upon building a row from a record. The renderer will call the closure with these parameters:$row An instance of Component; fill the mutator according to your needs and the structure of your record. $record An element of the table's data. This is the actually variable part when rendering rows. $ui_factory You might, e.g., want a descriptive listing or and image within the content of the row. Use the UI-Factory to build it. $environment When you need auxiliary classes or functions to properly render the data, this is the place to put it.In short: The closure MUST accept the following parameter $row mixed $record $ui_factory mixed $environment The closure MUST return

Implements ILIAS\UI\Component\Table\Presentation.

Definition at line 64 of file Presentation.php.

64  : T\Presentation
65  {
66  $clone = clone $this;
67  $clone->row_mapping = $row_mapping;
68  return $clone;
69  }

Field Documentation

◆ $environment

array ILIAS\UI\Implementation\Component\Table\Presentation::$environment = []
private

◆ $records

array ILIAS\UI\Implementation\Component\Table\Presentation::$records = []
private

◆ $signal_toggle_all

Signal ILIAS\UI\Implementation\Component\Table\Presentation::$signal_toggle_all
protected

The documentation for this class was generated from the following file: