ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
GridCellRetrieval.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2024 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5declare(strict_types=1);
6
8
10use ILIAS\Repository\RetrievalBase;
13
18{
19 use RetrievalBase;
20
21 public function __construct(
22 protected \ilPCGrid $grid
23 ) {
24 }
25
26 public function getData(
27 array $fields,
28 ?Range $range = null,
29 ?Order $order = null,
30 array $filter = [],
31 array $parameters = []
32 ): \Generator {
33 $data = $this->grid->getCellData();
34
35 foreach ($data as $v) {
36 $row = $v;
37 // Add mandatory 'id' field for TableAdapterGUI
38 $row["id"] = $v["hier_id"] . ":" . $v["pc_id"];
39 yield $row;
40 }
41 }
42
43 public function count(
44 array $filter,
45 array $parameters
46 ): int {
47 return count($this->grid->getCellData());
48 }
49
50 public function isFieldNumeric(
51 string $field
52 ): bool {
53 return false;
54 }
55}
getData(array $fields, ?Range $range=null, ?Order $order=null, array $filter=[], array $parameters=[])
count(array $filter, array $parameters)
__construct(protected \ilPCGrid $grid)
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...