ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
CollectionDataSource.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
25 
30 {
31  public function __construct(
32  string $collection_id
33  ) {
34  global $DIC;
36  $DIC->resourceStorage()->collection()->id($collection_id, 6) // ad hoc collection
37  );
38  }
39 
40  public function getSortationsMapping(): array
41  {
42  return [
43  SortDirection::BY_SIZE_DESC => 'fsd', // Default
47  ];
48  }
49 
50  public function handleFilters(Standard $filter): void
51  {
52  // TODO: Implement handleFilters() method.
53  }
54 
55  public function process(): void
56  {
57  switch ($this->sort_direction) {
59  $this->collection = $this->sorter->desc()->bySize();
60  break;
62  $this->collection = $this->sorter->asc()->bySize();
63  break;
65  $this->collection = $this->sorter->asc()->byTitle();
66  break;
68  $this->collection = $this->sorter->desc()->byTitle();
69  break;
70  }
71  $this->filtered_amount_of_items = $this->collection->count();
72  }
73 
77  public function getResourceIdentifications(): array
78  {
79  return $this->irss->collection()->rangeAsArray(
80  $this->collection,
81  $this->offset,
82  $this->limit
83  );
84  }
85 }
global $DIC
Definition: shib_login.php:25
__construct(Container $dic, ilPlugin $plugin)