ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
PossibleObjectsRetrieval.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26use ILIAS\Repository\RetrievalBase;
28use ilObject;
30use ILIAS\UI\Factory as UIFactory;
31
33{
34 use RetrievalBase;
35
36 public function __construct(
37 protected ilContainerStartObjects $start_objects
38 ) {
39 }
40
41 public function getData(
42 array $fields,
43 ?Range $range = null,
44 ?Order $order = null,
45 array $filter = [],
46 array $parameters = []
47 ): \Generator {
48 foreach ($this->start_objects->getPossibleStarters() as $item_ref_id) {
49 $data = [];
50 $tmp_obj = ilObjectFactory::getInstanceByRefId($item_ref_id);
51
52 $data['id'] = $item_ref_id;
53 $data['title'] = $tmp_obj->getTitle();
54 $data['type'] = $tmp_obj->getType();
55
56 if ($tmp_obj->getDescription() !== '') {
57 $data['description'] = $tmp_obj->getDescription();
58 }
59
60 yield $data;
61 }
62 }
63
64 public function count(
65 array $filter,
66 array $parameters
67 ): int {
68 return count($this->start_objects->getPossibleStarters());
69 }
70
71 public function isFieldNumeric(string $field): bool
72 {
73 return $field === 'id';
74 }
75}
getData(array $fields, ?Range $range=null, ?Order $order=null, array $filter=[], array $parameters=[])
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
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...
Class ilObjectFactory This class offers methods to get instances of the type-specific object classes ...
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObject Basic functions for all objects.
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...