ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjectRequestRetriever Class Reference

Base class for all sub item list gui's. More...

+ Collaboration diagram for ilObjectRequestRetriever:

Public Member Functions

 __construct (WrapperFactory $wrapper, Factory $refinery)
 
 has (string $key)
 
 getMaybeInt (string $key, ?int $fallback=null)
 
 getMaybeString (string $key, ?string $fallback=null)
 
 getArrayOfInt (string $key)
 
 getBool (string $key)
 
 getSelectedIdsFromObjectList ()
 

Protected Attributes

WrapperFactory $wrapper
 
Factory $refinery
 

Private Member Functions

 getFromRequest (string $key, Transformation $t)
 

Detailed Description

Base class for all sub item list gui's.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 30 of file class.ilObjectRequestRetriever.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjectRequestRetriever::__construct ( WrapperFactory  $wrapper,
Factory  $refinery 
)

Definition at line 35 of file class.ilObjectRequestRetriever.php.

References $refinery, $wrapper, and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Member Function Documentation

◆ getArrayOfInt()

ilObjectRequestRetriever::getArrayOfInt ( string  $key)

Definition at line 71 of file class.ilObjectRequestRetriever.php.

71 : array
72 {
73 return $this->getFromRequest(
74 $key,
75 $this->refinery->kindlyTo()->dictOf(
76 $this->refinery->kindlyTo()->int()
77 )
78 ) ?? [];
79 }
getFromRequest(string $key, Transformation $t)

References getFromRequest(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ getBool()

ilObjectRequestRetriever::getBool ( string  $key)

Definition at line 81 of file class.ilObjectRequestRetriever.php.

81 : bool
82 {
83 return $this->getFromRequest($key, $this->refinery->kindlyTo()->bool()) ?? false;
84 }

References getFromRequest(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ getFromRequest()

ilObjectRequestRetriever::getFromRequest ( string  $key,
Transformation  $t 
)
private
Returns
mixed

Definition at line 44 of file class.ilObjectRequestRetriever.php.

45 {
46 if ($this->wrapper->query()->has($key)) {
47 return $this->wrapper->query()->retrieve($key, $t);
48 }
49 if ($this->wrapper->post()->has($key)) {
50 return $this->wrapper->post()->retrieve($key, $t);
51 }
52 return null;
53 }

Referenced by getArrayOfInt(), getBool(), getMaybeInt(), and getMaybeString().

+ Here is the caller graph for this function:

◆ getMaybeInt()

ilObjectRequestRetriever::getMaybeInt ( string  $key,
?int  $fallback = null 
)

Definition at line 61 of file class.ilObjectRequestRetriever.php.

61 : ?int
62 {
63 return $this->getFromRequest($key, $this->refinery->kindlyTo()->int()) ?? $fallback;
64 }

References getFromRequest(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ getMaybeString()

ilObjectRequestRetriever::getMaybeString ( string  $key,
?string  $fallback = null 
)

Definition at line 66 of file class.ilObjectRequestRetriever.php.

66 : ?string
67 {
68 return $this->getFromRequest($key, $this->refinery->kindlyTo()->string()) ?? $fallback;
69 }

References getFromRequest(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ getSelectedIdsFromObjectList()

ilObjectRequestRetriever::getSelectedIdsFromObjectList ( )

Definition at line 86 of file class.ilObjectRequestRetriever.php.

86 : array
87 {
88 if ($this->wrapper->query()->has('tl_id')) {
89 return [$this->wrapper->query()->retrieve(
90 'tl_id',
91 $this->refinery->kindlyTo()->int()
92 )];
93 }
94 if ($this->wrapper->post()->has('id')) {
95 return $this->wrapper->post()->retrieve(
96 'id',
97 $this->refinery->container()->mapValues(
98 $this->refinery->kindlyTo()->int()
99 )
100 );
101 }
102
103 return [];
104 }

References ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ has()

ilObjectRequestRetriever::has ( string  $key)

Definition at line 55 of file class.ilObjectRequestRetriever.php.

55 : bool
56 {
57 return $this->wrapper->query()->has($key)
58 || $this->wrapper->post()->has($key);
59 }

Field Documentation

◆ $refinery

Factory ilObjectRequestRetriever::$refinery
protected

Definition at line 33 of file class.ilObjectRequestRetriever.php.

Referenced by __construct().

◆ $wrapper

WrapperFactory ilObjectRequestRetriever::$wrapper
protected

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

Referenced by __construct().


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