ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
SlotConstructor.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\LegalDocuments;
22 
24 use Closure;
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  {
72  return new DatabaseDocumentRepository(
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 }
readOnlyDocuments(DocumentRepository $document_repository)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
__construct(private readonly string $id, private readonly Container $container, private readonly UserAction $action)
$container
Definition: wac.php:36
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
history(ProvideDocument $document)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
document(DocumentRepository $document_repository, SelectionMap $conditions, array $content_as_component)