ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
ILIAS\LegalDocuments\Provide\ProvideHistory Class Reference
+ Collaboration diagram for ILIAS\LegalDocuments\Provide\ProvideHistory:

Public Member Functions

 __construct (private readonly string $id, private readonly HistoryRepository $repository, private readonly ProvideDocument $document, private readonly Container $container, ?Closure $create_table_gui=null)
 
 table (object $gui, string $command, string $reset_command, string $auto_complete_command)
 
 acceptDocument (ilObjUser $user, Document $document)
 
 alreadyAccepted (ilObjUser $user, Document $document)
 
 acceptedVersion (ilObjUser $user)
 
 currentDocumentOfAcceptedVersion (ilObjUser $user)
 

Private Attributes

readonly Closure $create_table_gui
 

Detailed Description

Definition at line 37 of file ProvideHistory.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LegalDocuments\Provide\ProvideHistory::__construct ( private readonly string  $id,
private readonly HistoryRepository  $repository,
private readonly ProvideDocument  $document,
private readonly Container  $container,
?Closure  $create_table_gui = null 
)
Parameters
null|Closure(object,string,TableInterface)Table $create_table_gui

Definition at line 45 of file ProvideHistory.php.

51  {
52  $this->create_table_gui = $create_table_gui ?? fn($gui, $command, $t) => new Table($gui, $command, $t);
53  }

Member Function Documentation

◆ acceptDocument()

ILIAS\LegalDocuments\Provide\ProvideHistory::acceptDocument ( ilObjUser  $user,
Document  $document 
)

Definition at line 77 of file ProvideHistory.php.

References ILIAS\UI\examples\Deck\repository().

77  : void
78  {
79  $this->repository->acceptDocument($user, $document);
80  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ acceptedVersion()

ILIAS\LegalDocuments\Provide\ProvideHistory::acceptedVersion ( ilObjUser  $user)
Returns
Result<DocumentContent>

Definition at line 90 of file ProvideHistory.php.

References ILIAS\UI\examples\Deck\repository().

90  : Result
91  {
92  return $this->repository->acceptedVersion($user);
93  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ alreadyAccepted()

ILIAS\LegalDocuments\Provide\ProvideHistory::alreadyAccepted ( ilObjUser  $user,
Document  $document 
)

Definition at line 82 of file ProvideHistory.php.

References ILIAS\UI\examples\Deck\repository().

82  : bool
83  {
84  return $this->repository->alreadyAccepted($user, $document);
85  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ currentDocumentOfAcceptedVersion()

ILIAS\LegalDocuments\Provide\ProvideHistory::currentDocumentOfAcceptedVersion ( ilObjUser  $user)
Returns
Result<Document>

Definition at line 98 of file ProvideHistory.php.

References ILIAS\UI\examples\Deck\repository().

98  : Result
99  {
100  return $this->repository->currentDocumentOfAcceptedVersion($user);
101  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ table()

ILIAS\LegalDocuments\Provide\ProvideHistory::table ( object  $gui,
string  $command,
string  $reset_command,
string  $auto_complete_command 
)

Definition at line 55 of file ProvideHistory.php.

References ILIAS\LegalDocuments\Provide\ProvideHistory\$create_table_gui, ilObjUser\_lookupLogin(), ILIAS\LegalDocuments\Provide\document(), null, and ILIAS\UI\examples\Deck\repository().

55  : Component
56  {
57  $auto_complete_link = $this->container->ctrl()->getLinkTarget($gui, $auto_complete_command, '', true);
58  $ui = new UI($this->id, $this->container->ui(), $this->container->language());
59  $modal = new DocumentModal($this->container->ui(), $this->document->contentAsComponent(...));
60  $create = fn(string $class, ...$args) => $class === ilObjUser::class && !ilObjUser::_lookupLogin($args[0]) ?
61  null :
62  new $class(...$args);
63 
64  $table = ($this->create_table_gui)($gui, $command, new HistoryTable(
65  $this->repository,
66  $this->document,
67  $reset_command,
68  $auto_complete_link,
69  $ui,
70  $modal,
71  $create
72  ));
73 
74  return $this->container->ui()->factory()->legacy()->content($table->getHTML());
75  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _lookupLogin(int $a_user_id)
+ Here is the call graph for this function:

Field Documentation

◆ $create_table_gui

readonly Closure ILIAS\LegalDocuments\Provide\ProvideHistory::$create_table_gui
private

The documentation for this class was generated from the following file: