ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
CollectionDataSource.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26
31{
32 public function __construct(
33 string $collection_id
34 ) {
35 global $DIC;
37 $DIC->resourceStorage()->collection()->id($collection_id, 6) // ad hoc collection
38 );
39 }
40
41 public function getSortationsMapping(): array
42 {
43 return [
44 SortDirection::BY_SIZE_DESC => 'fsd', // Default
48 ];
49 }
50
51 public function handleFilters(Standard $filter): void
52 {
53 // TODO: Implement handleFilters() method.
54 }
55
56 public function process(): void
57 {
58 switch ($this->sort_direction) {
60 $this->collection = $this->sorter->desc()->bySize();
61 break;
63 $this->collection = $this->sorter->asc()->bySize();
64 break;
66 $this->collection = $this->sorter->asc()->byTitle();
67 break;
69 $this->collection = $this->sorter->desc()->byTitle();
70 break;
71 }
72 $this->filtered_amount_of_items = $this->collection->count();
73 }
74
78 #[\Override]
79 public function getResourceIdentifications(): array
80 {
81 return $this->irss->collection()->rangeAsArray(
82 $this->collection,
83 $this->offset,
84 $this->limit
85 );
86 }
87}
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26