ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository Class Reference
+ Inheritance diagram for ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository:
+ Collaboration diagram for ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository:

Public Member Functions

 __construct (private readonly DocumentRepository $repository)
 
 all (int $offset=0, ?int $limit=null)
 
 countAll ()
 
 select (array $ids)
 
 find (int $id)
 
 findId (DocumentId $document_id)
 
 createDocument (string $title, DocumentContent $content)
 
 createCriterion (Document $document, CriterionContent $content)
 
 deleteDocument (Document $document)
 
 deleteCriterion (int $criterion_id)
 
 updateDocumentTitle (DocumentId $document_id, string $title)
 
 updateDocumentContent (DocumentId $document_id, DocumentContent $content)
 
 updateDocumentOrder (DocumentId $document_id, int $order)
 
 updateCriterionContent (int $criterion_id, CriterionContent $content)
 
 documentFromRow (array $row, array $criteria)
 
 documentTable ()
 
 exists (string $doc_id_name)
 

Private Member Functions

 checkAccess (string $method)
 

Private Attributes

const WHITELIST
 

Detailed Description

Definition at line 30 of file ReadOnlyDocumentRepository.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::__construct ( private readonly DocumentRepository  $repository)

Definition at line 44 of file ReadOnlyDocumentRepository.php.

45  {
46  }

Member Function Documentation

◆ all()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::all ( int  $offset = 0,
?int  $limit = null 
)
Returns
list<Document>

Implements ILIAS\LegalDocuments\Repository\DocumentRepository.

Definition at line 51 of file ReadOnlyDocumentRepository.php.

References ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\checkAccess(), and ILIAS\UI\examples\Deck\repository().

51  : array
52  {
53  $this->checkAccess(__FUNCTION__);
54  return $this->repository->all();
55  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ checkAccess()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::checkAccess ( string  $method)
private

Definition at line 157 of file ReadOnlyDocumentRepository.php.

Referenced by ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\all(), ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\countAll(), ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\createCriterion(), ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\createDocument(), ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\deleteCriterion(), ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\deleteDocument(), ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\documentFromRow(), ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\documentTable(), ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\exists(), ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\find(), ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\findId(), ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\select(), ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\updateCriterionContent(), ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\updateDocumentContent(), ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\updateDocumentOrder(), and ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\updateDocumentTitle().

157  : void
158  {
159  if (!in_array($method, self::WHITELIST, true)) {
160  throw new Exception('You are not allowed to call this method.');
161  }
162  }
+ Here is the caller graph for this function:

◆ countAll()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::countAll ( )

Implements ILIAS\LegalDocuments\Repository\DocumentRepository.

Definition at line 57 of file ReadOnlyDocumentRepository.php.

References ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\checkAccess(), and ILIAS\UI\examples\Deck\repository().

57  : int
58  {
59  $this->checkAccess(__FUNCTION__);
60  return $this->repository->countAll();
61  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ createCriterion()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::createCriterion ( Document  $document,
CriterionContent  $content 
)

Implements ILIAS\LegalDocuments\Repository\DocumentRepository.

Definition at line 97 of file ReadOnlyDocumentRepository.php.

References ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\checkAccess(), and ILIAS\UI\examples\Deck\repository().

97  : void
98  {
99  $this->checkAccess(__FUNCTION__);
100  $this->repository->createCriterion($document, $content);
101  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ createDocument()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::createDocument ( string  $title,
DocumentContent  $content 
)

Implements ILIAS\LegalDocuments\Repository\DocumentRepository.

Definition at line 91 of file ReadOnlyDocumentRepository.php.

References ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\checkAccess(), and ILIAS\UI\examples\Deck\repository().

91  : void
92  {
93  $this->checkAccess(__FUNCTION__);
94  $this->repository->createDocument($title, $content);
95  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ deleteCriterion()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::deleteCriterion ( int  $criterion_id)

Implements ILIAS\LegalDocuments\Repository\DocumentRepository.

Definition at line 109 of file ReadOnlyDocumentRepository.php.

References ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\checkAccess(), and ILIAS\UI\examples\Deck\repository().

109  : void
110  {
111  $this->checkAccess(__FUNCTION__);
112  $this->repository->deleteCriterion($criterion_id);
113  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ deleteDocument()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::deleteDocument ( Document  $document)

Implements ILIAS\LegalDocuments\Repository\DocumentRepository.

Definition at line 103 of file ReadOnlyDocumentRepository.php.

References ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\checkAccess(), and ILIAS\UI\examples\Deck\repository().

103  : void
104  {
105  $this->checkAccess(__FUNCTION__);
106  $this->repository->deleteDocument($document);
107  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ documentFromRow()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::documentFromRow ( array  $row,
array  $criteria 
)
Parameters
array<string,mixed>$row
list<Criterion>$criteria

Implements ILIAS\LegalDocuments\Repository\DocumentRepositoryMeta.

Definition at line 139 of file ReadOnlyDocumentRepository.php.

References ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\checkAccess(), and ILIAS\UI\examples\Deck\repository().

139  : Document
140  {
141  $this->checkAccess(__FUNCTION__);
142  return $this->repository->documentFromRow($row, $criteria);
143  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ documentTable()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::documentTable ( )

Implements ILIAS\LegalDocuments\Repository\DocumentRepositoryMeta.

Definition at line 145 of file ReadOnlyDocumentRepository.php.

References ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\checkAccess(), and ILIAS\UI\examples\Deck\repository().

145  : string
146  {
147  $this->checkAccess(__FUNCTION__);
148  return $this->repository->documentTable();
149  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ exists()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::exists ( string  $doc_id_name)

Implements ILIAS\LegalDocuments\Repository\DocumentRepositoryMeta.

Definition at line 151 of file ReadOnlyDocumentRepository.php.

References ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\checkAccess(), and ILIAS\UI\examples\Deck\repository().

151  : string
152  {
153  $this->checkAccess(__FUNCTION__);
154  return $this->repository->exists($doc_id_name);
155  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ find()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::find ( int  $id)
Returns
Result<Document>

Implements ILIAS\LegalDocuments\Repository\DocumentRepository.

Definition at line 76 of file ReadOnlyDocumentRepository.php.

References ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\checkAccess(), and ILIAS\UI\examples\Deck\repository().

76  : Result
77  {
78  $this->checkAccess(__FUNCTION__);
79  return $this->repository->find($id);
80  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ findId()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::findId ( DocumentId  $document_id)
Returns
Result<Document>

Implements ILIAS\LegalDocuments\Repository\DocumentRepository.

Definition at line 85 of file ReadOnlyDocumentRepository.php.

References ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\checkAccess(), and ILIAS\UI\examples\Deck\repository().

85  : Result
86  {
87  $this->checkAccess(__FUNCTION__);
88  return $this->repository->findId($document_id);
89  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ select()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::select ( array  $ids)
Parameters
list<int>$ids
Returns
list<Document>

Implements ILIAS\LegalDocuments\Repository\DocumentRepository.

Definition at line 67 of file ReadOnlyDocumentRepository.php.

References ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\checkAccess(), and ILIAS\UI\examples\Deck\repository().

67  : array
68  {
69  $this->checkAccess(__FUNCTION__);
70  return $this->repository->select($ids);
71  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ updateCriterionContent()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::updateCriterionContent ( int  $criterion_id,
CriterionContent  $content 
)

Implements ILIAS\LegalDocuments\Repository\DocumentRepository.

Definition at line 133 of file ReadOnlyDocumentRepository.php.

References ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\checkAccess(), and ILIAS\UI\examples\Deck\repository().

133  : void
134  {
135  $this->checkAccess(__FUNCTION__);
136  $this->repository->updateCriterionContent($criterion_id, $content);
137  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ updateDocumentContent()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::updateDocumentContent ( DocumentId  $document_id,
DocumentContent  $content 
)

Implements ILIAS\LegalDocuments\Repository\DocumentRepository.

Definition at line 121 of file ReadOnlyDocumentRepository.php.

References ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\checkAccess(), and ILIAS\UI\examples\Deck\repository().

121  : void
122  {
123  $this->checkAccess(__FUNCTION__);
124  $this->repository->updateDocumentContent($document_id, $content);
125  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ updateDocumentOrder()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::updateDocumentOrder ( DocumentId  $document_id,
int  $order 
)

Implements ILIAS\LegalDocuments\Repository\DocumentRepository.

Definition at line 127 of file ReadOnlyDocumentRepository.php.

References ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\checkAccess(), and ILIAS\UI\examples\Deck\repository().

127  : void
128  {
129  $this->checkAccess(__FUNCTION__);
130  $this->repository->updateDocumentOrder($document_id, $order);
131  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

◆ updateDocumentTitle()

ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::updateDocumentTitle ( DocumentId  $document_id,
string  $title 
)

Implements ILIAS\LegalDocuments\Repository\DocumentRepository.

Definition at line 115 of file ReadOnlyDocumentRepository.php.

References ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository\checkAccess(), and ILIAS\UI\examples\Deck\repository().

115  : void
116  {
117  $this->checkAccess(__FUNCTION__);
118  $this->repository->updateDocumentTitle($document_id, $title);
119  }
repository()
description: > Example for rendering a repository card
Definition: repository.php:33
+ Here is the call graph for this function:

Field Documentation

◆ WHITELIST

const ILIAS\LegalDocuments\Repository\ReadOnlyDocumentRepository::WHITELIST
private
Initial value:
= [
'all',
'countAll',
'select',
'find',
'findId',
'documentFromRow',
'documentTable',
'exists',
]

Definition at line 33 of file ReadOnlyDocumentRepository.php.


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