ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ClipboardRetrieval.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25use ILIAS\Repository\RetrievalBase;
27
29{
30 use RetrievalBase;
31
32 public function __construct(
33 protected \ilObjUser $user
34 ) {
35 }
36
37 public function getData(
38 array $fields,
39 ?Range $range = null,
40 ?Order $order = null,
41 array $filter = [],
42 array $parameters = []
43 ): \Generator {
44 $data = [];
45 foreach (["mob", "incl"] as $type) {
46 foreach ($this->user->getClipboardObjects($type) as $item) {
47 $item["source_id"] = $item["id"];
48 $item["id"] = $type . ":" . $item["id"];
49 $data[] = $item;
50 }
51 }
52
53 $data = $this->applyOrder($data, $order);
54 $data = $this->applyRange($data, $range);
55
56 foreach ($data as $row) {
57 yield $row;
58 }
59 }
60
61 public function count(array $filter, array $parameters): int
62 {
63 return count($this->getClipboardObjects());
64 }
65
66 public function isFieldNumeric(string $field): bool
67 {
68 return false;
69 }
70
71 protected function getClipboardObjects(): array
72 {
73 return array_merge(
74 $this->user->getClipboardObjects("mob"),
75 $this->user->getClipboardObjects("incl")
76 );
77 }
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
count(array $filter, array $parameters)
getData(array $fields, ?Range $range=null, ?Order $order=null, array $filter=[], array $parameters=[])
User class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$data
Definition: storeScorm.php:45