ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
TableRows.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Contact;
22 
28 use Generator;
29 use Closure;
30 
31 class TableRows implements DataRetrieval
32 {
36  public function __construct(private readonly Closure $rows)
37  {
38  }
39 
40  public function getRows(
41  DataRowBuilder $row_builder,
42  array $visible_column_ids,
43  Range $range,
44  Order $order,
45  ?array $filter_data,
46  ?array $additional_parameters
47  ): Generator {
48  return ($this->rows)(...func_get_args());
49  }
50 
51  public function getTotalRowCount(?array $filter_data, ?array $additional_parameters): ?int
52  {
53  return current(Pagination::DEFAULT_LIMITS) - 1; // Disable pagination controls.
54  }
55 }
getTotalRowCount(?array $filter_data, ?array $additional_parameters)
Mainly for the purpose of pagination-support, it is important to know about the total number of recor...
Definition: TableRows.php:51
getRows(DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, ?array $filter_data, ?array $additional_parameters)
This is called by the table to retrieve rows; map data-records to rows using the $row_builder e...
Definition: TableRows.php:40
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:28
__construct(private readonly Closure $rows)
Definition: TableRows.php:36
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:28