ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
EntityListing.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25use ILIAS\UI\Implementation\Component\ComponentHelper;
27
28abstract class EntityListing implements I\EntityListing
29{
30 use ComponentHelper;
31
33
34 public function __construct(
35 protected I\RecordToEntity $entity_mapping
36 ) {
37 }
38
39 public function withData(I\DataRetrieval $data): self
40 {
41 $clone = clone $this;
42 $clone->data = $data;
43 return $clone;
44 }
45
50 public function getEntities(
51 \ILIAS\UI\Factory $ui_factory,
52 ?Range $range = null,
53 ?array $additional_parameters = null
54 ): \Generator {
55 $mapping = new class ($this->entity_mapping, $ui_factory) implements I\Mapping {
56 public function __construct(
57 protected I\RecordToEntity $mapper,
58 protected \ILIAS\UI\Factory $ui_factory
59 ) {
60 }
61
62 public function map(mixed $record): IEntity\Entity
63 {
64 return $this->mapper->map($this->ui_factory, $record);
65 }
66 };
67
68 $additional_parameters = null;
69 return $this->data->getEntities($mapping, $range, $additional_parameters);
70 }
71}
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:29
getEntities(\ILIAS\UI\Factory $ui_factory, ?Range $range=null, ?array $additional_parameters=null)
__construct(protected I\RecordToEntity $entity_mapping)
Definition: UI.php:24
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.