ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
base.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27
34function base()
35{
36 global $DIC;
37 $f = $DIC['ui.factory'];
38 $r = $DIC['ui.renderer'];
39 $df = new \ILIAS\Data\Factory();
40
41 $columns = [
42 'd1' => $f->table()->column()->timeSpan("German Long", $df->dateFormat()->germanLong()),
43 'd2' => $f->table()->column()->timeSpan("German Short", $df->dateFormat()->germanShort())
44 ];
45
46 $data_retrieval = new class () implements I\DataRetrieval {
47 public function getRows(
48 I\DataRowBuilder $row_builder,
49 array $visible_column_ids,
51 Order $order,
52 mixed $additional_viewcontrol_data,
53 mixed $filter_data,
54 mixed $additional_parameters
55 ): \Generator {
56 $row_id = '';
57 $dat = new \DateTimeImmutable();
58 $dat2 = $dat->add(new \DateInterval('PT10H30S'));
59 $record = [
60 'd1' => [$dat, $dat2],
61 'd2' => [$dat, $dat2],
62 ];
63 yield $row_builder->buildDataRow($row_id, $record);
64 }
65
66 public function getTotalRowCount(
67 mixed $additional_viewcontrol_data,
68 mixed $filter_data,
69 mixed $additional_parameters
70 ): ?int {
71 return 1;
72 }
73 };
74
75 $table = $f->table()->data($data_retrieval, 'TimeSpan Columns', $columns)
76 ->withRequest($DIC->http()->request());
77 return $r->render($table);
78}
Both the subject and the direction need to be specified when expressing an order.
Definition: Order.php:29
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:29