ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
BaseTableDataSource.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
28 
32 abstract class BaseTableDataSource implements TableDataSource
33 {
34  protected \ilDBInterface $db;
35  protected Services $irss;
37  protected \ILIAS\ResourceStorage\Collection\Sorter\Sorter $sorter;
38  protected int $filtered_amount_of_items = 0;
39  protected int $offset = 0;
40  protected int $limit = 50;
42  protected ?array $filter_values = null;
43 
44  public function __construct(
46  ) {
47  global $DIC;
48  $this->db = $DIC->database();
49  $this->irss = $DIC->resourceStorage();
50  $this->collection = $this->irss->collection()->get(
51  $rcid
52  );
53  $this->sorter = $this->irss->collection()->sort($this->collection);
54  }
55 
56 
57  public function setOffsetAndLimit(int $offset, int $limit): void
58  {
59  $this->offset = $offset;
60  $this->limit = $limit;
61  }
62 
63  public function setSortDirection(int $sort_direction): void
64  {
65  $this->sort_direction = $sort_direction;
66  }
67 
68 
69  public function getFilteredAmountOfItems(): int
70  {
72  }
73 
74 
75  public function getResourceIdentifications(): array
76  {
77  return $this->collection->getResourceIdentifications();
78  }
79 
80  public function getFilterItems(
81  Factory $ui_factory,
83  ): array {
84  return [];
85  }
86 
87  public function applyFilterValues(?array $filter_values): void
88  {
89  $this->filter_values = $filter_values;
90  }
91 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This is how the factory for UI elements looks.
Definition: Factory.php:37
global $DIC
Definition: shib_login.php:25
global $lng
Definition: privfeed.php:32