ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ILIAS\Repository\Table\TableRetrieval Class Reference
+ Inheritance diagram for ILIAS\Repository\Table\TableRetrieval:
+ Collaboration diagram for ILIAS\Repository\Table\TableRetrieval:

Public Member Functions

 __construct (protected RetrievalInterface $retrieval, protected array $actions, protected ?\Closure $active_action_closure, protected ?\Closure $row_transformer)
 
 getRows (Table\DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 
 getTotalRowCount (mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 Mainly for the purpose of pagination-support, it is important to know about the total number of records available. More...
 
- Public Member Functions inherited from ILIAS\UI\Component\Table\DataRetrieval
 getRows (DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 
 getTotalRowCount (mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 Mainly for the purpose of pagination-support, it is important to know about the total number of records available. More...
 

Detailed Description

Definition at line 28 of file TableRetrieval.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Repository\Table\TableRetrieval::__construct ( protected RetrievalInterface  $retrieval,
protected array  $actions,
protected ?\Closure  $active_action_closure,
protected ?\Closure  $row_transformer 
)

Definition at line 30 of file TableRetrieval.php.

35 {
36 }

Member Function Documentation

◆ getRows()

ILIAS\Repository\Table\TableRetrieval::getRows ( Table\DataRowBuilder  $row_builder,
array  $visible_column_ids,
Range  $range,
Order  $order,
mixed  $additional_viewcontrol_data,
mixed  $filter_data,
mixed  $additional_parameters 
)

Definition at line 38 of file TableRetrieval.php.

46 : \Generator {
47 foreach ($this->retrieval->getData(
48 $visible_column_ids,
49 $range,
50 $order,
51 $filter_data ?? [],
52 $additional_parameters ?? []
53 ) as $data) {
54 if ($this->row_transformer) {
55 $table_data = ($this->row_transformer)($data);
56 } else {
57 $table_data = $data;
58 }
59 $row = $row_builder->buildDataRow((string) $data["id"], $table_data);
60 if ($this->active_action_closure) {
61 foreach ($this->actions as $action) {
62 if (!($this->active_action_closure)($action, $data)) {
63 $row = $row->withDisabledAction($action);
64 }
65 }
66 }
67 yield $row;
68 }
69 }

References $data.

◆ getTotalRowCount()

ILIAS\Repository\Table\TableRetrieval::getTotalRowCount ( mixed  $additional_viewcontrol_data,
mixed  $filter_data,
mixed  $additional_parameters 
)

Mainly for the purpose of pagination-support, it is important to know about the total number of records available.

Given the nature of a DataTable, which is, opposite to a PresentationTable, rather administrative than explorative, this information will increase user experience quite a bit. However, you may return null, if the call is to costly, but expect the View Control to look a little different in this case.

Make sure that potential filters or user restrictions are being applied to the count.

Implements ILIAS\UI\Component\Table\DataRetrieval.

Definition at line 71 of file TableRetrieval.php.

75 : ?int {
76 return $this->retrieval->count(
77 $filter_data ?? [],
78 $additional_parameters ?? []
79 );
80 }

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