ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\TestQuestionPool\InternalRequestService Class Reference
+ Collaboration diagram for ILIAS\TestQuestionPool\InternalRequestService:

Public Member Functions

 __construct (\ILIAS\HTTP\Services $http, \ILIAS\Refinery\Factory $refinery, \ILIAS\FileUpload\FileUpload $upload)
 
 getProcessedUploads ()
 
 upload ()
 
 isset (string $key)
 
 hasRefId ()
 
 getRefId ()
 
 hasQuestionId ()
 
 getQuestionId ()
 
 getIds ()
 
 raw (string $key)
 
 float (string $key)
 
 string (string $key)
 
 getParsedBody ()
 
 getUnitIds ()
 
 getUnitCategoryIds ()
 

Protected Attributes

ILIAS HTTP Services $http
 
ILIAS FileUpload FileUpload $upload
 

Detailed Description

Definition at line 25 of file class.InternalRequestService.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\TestQuestionPool\InternalRequestService::__construct ( \ILIAS\HTTP\Services  $http,
\ILIAS\Refinery\Factory  $refinery,
\ILIAS\FileUpload\FileUpload  $upload 
)

Definition at line 32 of file class.InternalRequestService.php.

References ILIAS\TestQuestionPool\InternalRequestService\$upload, ILIAS\Repository\initRequest(), and ILIAS\TestQuestionPool\InternalRequestService\upload().

36  {
37  $this->initRequest(
38  $http,
39  $refinery
40  );
41  $this->upload = $upload;
42  }
initRequest(HTTP\Services $http, Refinery\Factory $refinery, ?array $passed_query_params=null, ?array $passed_post_data=null)
Query params and post data parameters are used for testing.
Refinery Factory $refinery
+ Here is the call graph for this function:

Member Function Documentation

◆ float()

ILIAS\TestQuestionPool\InternalRequestService::float ( string  $key)

Definition at line 134 of file class.InternalRequestService.php.

References Vendor\Package\$e, ILIAS\LTI\ToolProvider\$key, and ILIAS\Repository\refinery().

134  : ?float
135  {
136  $t = $this->refinery->kindlyTo()->float();
137  try {
138  return $this->get($key, $t) ?? 0.0;
139  } catch (ConstraintViolationException $e) {
140  return 0.0;
141  }
142  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

◆ getIds()

ILIAS\TestQuestionPool\InternalRequestService::getIds ( )
Returns
string[]

Definition at line 120 of file class.InternalRequestService.php.

References ILIAS\Repository\strArray().

120  : array
121  {
122  return $this->strArray("id");
123  }
+ Here is the call graph for this function:

◆ getParsedBody()

ILIAS\TestQuestionPool\InternalRequestService::getParsedBody ( )

Definition at line 150 of file class.InternalRequestService.php.

References ILIAS\FileDelivery\http().

151  {
152  return $this->http->request()->getParsedBody();
153  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

◆ getProcessedUploads()

ILIAS\TestQuestionPool\InternalRequestService::getProcessedUploads ( )
Returns
[]

Definition at line 47 of file class.InternalRequestService.php.

References Vendor\Package\$c, ILIAS\FileDelivery\http(), ILIAS\TestQuestionPool\InternalRequestService\isset(), and ILIAS\TestQuestionPool\InternalRequestService\upload().

47  : array
48  {
49  $uploads = [];
50  if ($this->upload->hasUploads()) {
51  if (!$this->upload->hasBeenProcessed()) {
52  $this->upload->process();
53  }
54  $uploads = $this->upload->getResults();
55  }
56 
57  return $uploads;
58  }
+ Here is the call graph for this function:

◆ getQuestionId()

ILIAS\TestQuestionPool\InternalRequestService::getQuestionId ( )

Definition at line 114 of file class.InternalRequestService.php.

References ILIAS\Repository\int().

114  : int
115  {
116  return $this->int('q_id');
117  }
+ Here is the call graph for this function:

◆ getRefId()

ILIAS\TestQuestionPool\InternalRequestService::getRefId ( )

Definition at line 104 of file class.InternalRequestService.php.

References ILIAS\Repository\int().

104  : int
105  {
106  return $this->int("ref_id");
107  }
+ Here is the call graph for this function:

◆ getUnitCategoryIds()

ILIAS\TestQuestionPool\InternalRequestService::getUnitCategoryIds ( )
Returns
int[]

Definition at line 166 of file class.InternalRequestService.php.

References ILIAS\Repository\intArray().

166  : array
167  {
168  return $this->intArray("category_ids");
169  }
+ Here is the call graph for this function:

◆ getUnitIds()

ILIAS\TestQuestionPool\InternalRequestService::getUnitIds ( )
Returns
int[]

Definition at line 158 of file class.InternalRequestService.php.

References ILIAS\Repository\intArray().

158  : array
159  {
160  return $this->intArray("unit_ids");
161  }
+ Here is the call graph for this function:

◆ hasQuestionId()

ILIAS\TestQuestionPool\InternalRequestService::hasQuestionId ( )

Definition at line 109 of file class.InternalRequestService.php.

References ILIAS\TestQuestionPool\InternalRequestService\raw().

109  : bool
110  {
111  return $this->raw('q_id') !== null;
112  }
+ Here is the call graph for this function:

◆ hasRefId()

ILIAS\TestQuestionPool\InternalRequestService::hasRefId ( )

Definition at line 99 of file class.InternalRequestService.php.

References ILIAS\TestQuestionPool\InternalRequestService\raw().

99  : int
100  {
101  return $this->raw('ref_id') !== null;
102  }
+ Here is the call graph for this function:

◆ isset()

ILIAS\TestQuestionPool\InternalRequestService::isset ( string  $key)

Definition at line 95 of file class.InternalRequestService.php.

References ILIAS\TestQuestionPool\InternalRequestService\raw().

Referenced by ILIAS\TestQuestionPool\InternalRequestService\getProcessedUploads().

95  : bool
96  {
97  return $this->raw($key) !== null;
98  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ raw()

ILIAS\TestQuestionPool\InternalRequestService::raw ( string  $key)
Returns
mixed|null

Definition at line 128 of file class.InternalRequestService.php.

References ILIAS\LTI\ToolProvider\$key, and ILIAS\Repository\refinery().

Referenced by ILIAS\TestQuestionPool\InternalRequestService\hasQuestionId(), ILIAS\TestQuestionPool\InternalRequestService\hasRefId(), and ILIAS\TestQuestionPool\InternalRequestService\isset().

129  {
130  $no_transform = $this->refinery->identity();
131  return $this->get($key, $no_transform);
132  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ string()

ILIAS\TestQuestionPool\InternalRequestService::string ( string  $key)

Definition at line 144 of file class.InternalRequestService.php.

References ILIAS\LTI\ToolProvider\$key, and ILIAS\Repository\refinery().

144  : string
145  {
146  $t = $this->refinery->kindlyTo()->string();
147  return $this->get($key, $t) ?? '';
148  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

◆ upload()

ILIAS\TestQuestionPool\InternalRequestService::upload ( )

Field Documentation

◆ $http

ILIAS HTTP Services ILIAS\TestQuestionPool\InternalRequestService::$http
protected

Definition at line 29 of file class.InternalRequestService.php.

◆ $upload

ILIAS FileUpload FileUpload ILIAS\TestQuestionPool\InternalRequestService::$upload
protected

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