ILIAS  trunk Revision v11.0_alpha-1702-gfd3ecb7f852
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
TableRetrieval.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 
27 class TableRetrieval implements Table\DataRetrieval
28 {
29  public function __construct(
30  protected RetrievalInterface $retrieval
31  ) {
32  }
33 
34  public function getRows(
35  Table\DataRowBuilder $row_builder,
36  array $visible_column_ids,
37  Range $range,
38  Order $order,
39  ?array $filter_data,
40  ?array $additional_parameters
41  ): \Generator {
42  foreach ($this->retrieval->getData(
43  $visible_column_ids,
44  $range,
45  $order,
46  $filter_data ?? [],
47  $additional_parameters ?? []
48  ) as $data) {
49  yield $row_builder->buildDataRow((string) $data["id"], $data);
50  }
51  }
52 
53  public function getTotalRowCount(
54  ?array $filter_data,
55  ?array $additional_parameters
56  ): ?int {
57  return $this->retrieval->count(
58  $filter_data ?? [],
59  $additional_parameters ?? []
60  );
61  }
62 }
__construct(protected RetrievalInterface $retrieval)
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:28
getRows(Table\DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, ?array $filter_data, ?array $additional_parameters)
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:28
getTotalRowCount(?array $filter_data, ?array $additional_parameters)