ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 }

References ILIAS\LegalDocuments\Provide\ProvideHistory\$create_table_gui.

Member Function Documentation

◆ acceptDocument()

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

Definition at line 77 of file ProvideHistory.php.

77 : void
78 {
79 $this->repository->acceptDocument($user, $document);
80 }

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

+ 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.

90 : Result
91 {
92 return $this->repository->acceptedVersion($user);
93 }

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

+ 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.

82 : bool
83 {
84 return $this->repository->alreadyAccepted($user, $document);
85 }

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

+ 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.

98 : Result
99 {
100 return $this->repository->currentDocumentOfAcceptedVersion($user);
101 }

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

+ 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.

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 }
static _lookupLogin(int $a_user_id)

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

+ 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: