ILIAS
trunk Revision v12.0_alpha-1227-g7ff6d300864
◀ ilDoc Overview
RequestParser.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\MetaData\OERHarvester\ControlCenter\Http
;
22
23
use
ILIAS\Refinery\Factory
as Refinery;
24
use
ILIAS\HTTP\GlobalHttpState
;
25
use
ilMDEditorException
;
26
27
class
RequestParser
implements
RequestParserInterface
28
{
29
protected
GlobalHttpState
$http
;
30
protected
Refinery
$refinery
;
31
32
public
function
__construct
(
33
GlobalHttpState
$http
,
34
Refinery
$refinery
35
) {
36
$this->
http
=
$http
;
37
$this->
refinery
=
$refinery
;
38
}
39
40
public
function
fetchRefID
():
int
41
{
42
$request_wrapper
= $this->
http
->wrapper()->query();
43
if
(
$request_wrapper
->has(
RequestParserInterface::REF_ID_PARAM
)) {
44
return
$request_wrapper
->retrieve(
45
RequestParserInterface::REF_ID_PARAM
,
46
$this->
refinery
->kindlyTo()->int()
47
);
48
}
49
throw
new
ilMDEditorException
(
'ref_id for control center not found.'
);
50
}
51
52
public
function
fetchObjID
():
int
53
{
54
$request_wrapper
= $this->
http
->wrapper()->query();
55
if
(
$request_wrapper
->has(
RequestParserInterface::OBJ_ID_PARAM
)) {
56
return
$request_wrapper
->retrieve(
57
RequestParserInterface::OBJ_ID_PARAM
,
58
$this->
refinery
->kindlyTo()->int()
59
);
60
}
61
throw
new
ilMDEditorException
(
'obj_id for control center not found.'
);
62
}
63
64
public
function
fetchType
(): string
65
{
66
$request_wrapper
= $this->
http
->wrapper()->query();
67
if
(
$request_wrapper
->has(
RequestParserInterface::TYPE_PARAM
)) {
68
return
$request_wrapper
->retrieve(
69
RequestParserInterface::TYPE_PARAM
,
70
$this->
refinery
->kindlyTo()->string()
71
);
72
}
73
throw
new
ilMDEditorException
(
'type for control center not found.'
);
74
}
75
}
ILIAS\Data\Factory
Builds data types.
Definition:
Factory.php:36
ILIAS\MetaData\OERHarvester\ControlCenter\Http\RequestParser
Definition:
RequestParser.php:28
ILIAS\MetaData\OERHarvester\ControlCenter\Http\RequestParser\$refinery
Refinery $refinery
Definition:
RequestParser.php:30
ILIAS\MetaData\OERHarvester\ControlCenter\Http\RequestParser\fetchType
fetchType()
Definition:
RequestParser.php:64
ILIAS\MetaData\OERHarvester\ControlCenter\Http\RequestParser\fetchRefID
fetchRefID()
Definition:
RequestParser.php:40
ILIAS\MetaData\OERHarvester\ControlCenter\Http\RequestParser\fetchObjID
fetchObjID()
Definition:
RequestParser.php:52
ILIAS\MetaData\OERHarvester\ControlCenter\Http\RequestParser\$http
GlobalHttpState $http
Definition:
RequestParser.php:29
ILIAS\MetaData\OERHarvester\ControlCenter\Http\RequestParser\__construct
__construct(GlobalHttpState $http, Refinery $refinery)
Definition:
RequestParser.php:32
ILIAS\Refinery
Definition:
Refinery.php:24
ilMDEditorException
Definition:
class.ilMDEditorException.php:22
ILIAS\HTTP\GlobalHttpState
Interface GlobalHttpState.
Definition:
GlobalHttpState.php:43
ILIAS\MetaData\OERHarvester\ControlCenter\Http\RequestParserInterface
Definition:
RequestParserInterface.php:24
ILIAS\MetaData\OERHarvester\ControlCenter\Http\RequestParserInterface\TYPE_PARAM
const string TYPE_PARAM
Definition:
RequestParserInterface.php:27
ILIAS\MetaData\OERHarvester\ControlCenter\Http\RequestParserInterface\REF_ID_PARAM
const string REF_ID_PARAM
Definition:
RequestParserInterface.php:25
ILIAS\MetaData\OERHarvester\ControlCenter\Http\RequestParserInterface\OBJ_ID_PARAM
const string OBJ_ID_PARAM
Definition:
RequestParserInterface.php:26
ILIAS\FileDelivery\http
static http()
Fetches the global http state from ILIAS.
Definition:
HttpServiceAware.php:55
ILIAS\MetaData\OERHarvester\ControlCenter\Http
Definition:
LinkFactory.php:21
ILIAS\Repository\int
int(string $key)
Definition:
trait.BaseGUIRequest.php:61
ILIAS\Repository\refinery
refinery()
Definition:
trait.GlobalDICDomainServices.php:76
ILIAS\UI\examples\Layout\Page\Mail\$request_wrapper
$request_wrapper
Definition:
base.php:56
components
ILIAS
MetaData
classes
OERHarvester
ControlCenter
Http
RequestParser.php
Generated on Wed Apr 8 2026 23:05:16 for ILIAS by
1.9.4 (using
Doxyfile
)