19declare(strict_types=1);
27use Psr\Http\Message\ServerRequestInterface;
29use
function array_map;
46 return $this->
http->request();
49 public function isset(
string $key): bool
51 return $this->
raw($key) !==
null;
56 return $this->
raw(
'ref_id') !==
null;
61 return $this->
int(
"ref_id");
72 return $this->
raw(
'q_id') !==
null;
77 return $this->
int(
'q_id');
87 return $this->
str(
'nextCommand');
92 return $this->
int(
'active_id');
97 return $this->
int(
'pass_id');
102 if (!$this->
http->wrapper()->post()->has($key)) {
106 return $this->
http->wrapper()->post()->retrieve(
109 $this->refinery->kindlyTo()->bool(),
110 $this->refinery->always(
null)
117 if (!$this->
http->wrapper()->query()->has(
'instresp')) {
121 return $this->
http->wrapper()->query()->retrieve(
124 $this->refinery->kindlyTo()->bool(),
125 $this->refinery->always(
false)
133 public function raw(
string $key): mixed
135 return $this->
get($key, $this->
refinery->identity());
138 public function strVal(
string $key): string
140 return $this->
str($key);
145 return $this->
http->request()->getParsedBody();
153 return $this->
http->wrapper()->post()->keys();
158 return $this->
http->request()->getMethod() ===
'POST';
179 return $this->
http->wrapper()->post()->retrieve(
182 $this->refinery->kindlyTo()->listOf($transformation),
183 $this->refinery->always([])
193 $p = $this->
http->wrapper()->query();
196 if (!$p->has($key)) {
202 $r->custom()->transformation(function ($value) {
203 return $value ===
'ALL_OBJECTS' || $value[0] ===
'ALL_OBJECTS' ?
'ALL_OBJECTS' : array_map(
'intval', $value);
trait BaseGUIRequest
Base gui request wrapper.
retrieveArrayFromPost(string $key, Transformation $transformation)
isInstanceResponseRequested()
retrieveArrayOfIntsFromPost(string $key)
retrieveArrayOfStringsFromPost(string $key)
retrieveBoolFromPost(string $key)
__construct(HTTPServices $http, Refinery $refinery)
getMultiSelectionIds(string $key)
static http()
Fetches the global http state from ILIAS.
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.