ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
SlotConstructor.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\LegalDocuments;
22
24use Closure;
33use ILIAS\LegalDocuments\ConsumerSlots\CriterionToCondition;
34
36{
37 public function __construct(private readonly string $id, private readonly Container $container, private readonly UserAction $action)
38 {
39 }
40
41 public function id(): string
42 {
43 return $this->id;
44 }
45
46 public function history(ProvideDocument $document): ProvideHistory
47 {
48 return new ProvideHistory(
49 $this->id(),
51 $this->id(),
52 $document->repository(),
53 $this->container->database(),
54 $this->action
55 ),
56 $document,
57 $this->container
58 );
59 }
60
65 public function document(DocumentRepository $document_repository, SelectionMap $conditions, array $content_as_component): ProvideDocument
66 {
67 return new ProvideDocument($this->id(), $document_repository, $conditions, $content_as_component, $this->container);
68 }
69
71 {
73 $this->id(),
74 $this->container->database(),
75 $this->action
76 );
77 }
78
79 public function readOnlyDocuments(DocumentRepository $document_repository): DocumentRepository
80 {
81 return new ReadOnlyDocumentRepository($document_repository);
82 }
83
88 public function withdrawalFinished(Closure $finished): Closure
89 {
90 return function () use ($finished): array {
91 if (($this->container->http()->request()->getQueryParams()['withdrawal_finished'] ?? null) === $this->id()) {
92 $finished();
93 }
94 return [];
95 };
96 }
97}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
__construct(private readonly string $id, private readonly Container $container, private readonly UserAction $action)
document(DocumentRepository $document_repository, SelectionMap $conditions, array $content_as_component)
history(ProvideDocument $document)
readOnlyDocuments(DocumentRepository $document_repository)
A component is the most general form of an entity in the UI.
Definition: Component.php:28
$container
@noRector
Definition: wac.php:37