ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\User\Profile\GUIRequest Class Reference
+ Collaboration diagram for ILIAS\User\Profile\GUIRequest:

Public Member Functions

 __construct (RequestServices $request, private Refinery $refinery)
 
 getUserId ()
 
 getBackUrl ()
 
 getBaseClass ()
 
 getPrompted ()
 
 getOsdId ()
 
 getFieldId ()
 
 getTerm ()
 
 getToken ()
 
 getUserFileCapture ()
 
 getParsedBody ()
 

Private Member Functions

 int (string $key)
 
 str (string $key)
 
 existsInPostOrQuery (string $key)
 
 getFromQueryOrPost (string $key, Transformation $transformation, string $source)
 

Private Attributes

WrapperFactory $wrapper
 
array $post
 

Detailed Description

Definition at line 28 of file GUIRequest.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\User\Profile\GUIRequest::__construct ( RequestServices  $request,
private Refinery  $refinery 
)

Definition at line 36 of file GUIRequest.php.

39  {
40  $this->wrapper = $request->wrapper();
41  $this->post = $request->request()->getParsedBody();
42  }

Member Function Documentation

◆ existsInPostOrQuery()

ILIAS\User\Profile\GUIRequest::existsInPostOrQuery ( string  $key)
private
Todo:
2023-06-05 sk: This is ugly and has to go, but right now, I have no idea, when I want to have information from $_POST or from $_GET.

Definition at line 134 of file GUIRequest.php.

Referenced by ILIAS\User\Profile\GUIRequest\int(), and ILIAS\User\Profile\GUIRequest\str().

134  : string
135  {
136  if ($this->wrapper->post()->has($key)) {
137  return 'post';
138  }
139 
140  if ($this->wrapper->query()->has($key)) {
141  return 'query';
142  }
143 
144  return '';
145  }
+ Here is the caller graph for this function:

◆ getBackUrl()

ILIAS\User\Profile\GUIRequest::getBackUrl ( )

Definition at line 53 of file GUIRequest.php.

References ILIAS\User\Profile\GUIRequest\str().

53  : string
54  {
55  return $this->str('back_url');
56  }
+ Here is the call graph for this function:

◆ getBaseClass()

ILIAS\User\Profile\GUIRequest::getBaseClass ( )

Definition at line 58 of file GUIRequest.php.

References ILIAS\User\Profile\GUIRequest\str().

58  : string
59  {
60  return $this->str('baseClass');
61  }
+ Here is the call graph for this function:

◆ getFieldId()

ILIAS\User\Profile\GUIRequest::getFieldId ( )

Definition at line 73 of file GUIRequest.php.

References ILIAS\User\Profile\GUIRequest\str().

73  : string
74  {
75  return $this->str('f');
76  }
+ Here is the call graph for this function:

◆ getFromQueryOrPost()

ILIAS\User\Profile\GUIRequest::getFromQueryOrPost ( string  $key,
Transformation  $transformation,
string  $source 
)
private

Definition at line 147 of file GUIRequest.php.

Referenced by ILIAS\User\Profile\GUIRequest\int(), and ILIAS\User\Profile\GUIRequest\str().

147  : string|int
148  {
149  if ($source === 'query') {
150  return $this->wrapper->query()->retrieve($key, $transformation);
151  }
152 
153  return $this->wrapper->post()->retrieve($key, $transformation);
154  }
+ Here is the caller graph for this function:

◆ getOsdId()

ILIAS\User\Profile\GUIRequest::getOsdId ( )

Definition at line 68 of file GUIRequest.php.

References ILIAS\User\Profile\GUIRequest\int().

68  : int
69  {
70  return $this->int('osd_id');
71  }
+ Here is the call graph for this function:

◆ getParsedBody()

ILIAS\User\Profile\GUIRequest::getParsedBody ( )
Todo:
2023-06-05 sk: This is not what we want, but in order to avoid having a RequestInterface and a GUIRequest as class attributes

Definition at line 125 of file GUIRequest.php.

References ILIAS\User\Profile\GUIRequest\$post.

125  : array
126  {
127  return $this->post;
128  }

◆ getPrompted()

ILIAS\User\Profile\GUIRequest::getPrompted ( )

Definition at line 63 of file GUIRequest.php.

References ILIAS\User\Profile\GUIRequest\int().

63  : int
64  {
65  return $this->int('prompted');
66  }
+ Here is the call graph for this function:

◆ getTerm()

ILIAS\User\Profile\GUIRequest::getTerm ( )

Definition at line 78 of file GUIRequest.php.

References ILIAS\User\Profile\GUIRequest\str().

78  : string
79  {
80  return $this->str('term');
81  }
+ Here is the call graph for this function:

◆ getToken()

ILIAS\User\Profile\GUIRequest::getToken ( )

Definition at line 83 of file GUIRequest.php.

References ILIAS\User\Profile\GUIRequest\str().

83  : string
84  {
85  return $this->str('token');
86  }
+ Here is the call graph for this function:

◆ getUserFileCapture()

ILIAS\User\Profile\GUIRequest::getUserFileCapture ( )

Definition at line 88 of file GUIRequest.php.

References ILIAS\User\Profile\GUIRequest\str().

88  : string
89  {
90  $capture = $this->str('userfile_capture');
91 
92  if ($capture !== '') {
93  return $capture;
94  }
95 
96  return $this->str('user_picture_carry');
97  }
+ Here is the call graph for this function:

◆ getUserId()

ILIAS\User\Profile\GUIRequest::getUserId ( )

Definition at line 44 of file GUIRequest.php.

References $user_id, and ILIAS\User\Profile\GUIRequest\int().

44  : int
45  {
46  $user_id = $this->int('user_id');
47  if ($user_id !== 0) {
48  return $this->int('user_id');
49  }
50  return $this->int('user');
51  }
+ Here is the call graph for this function:

◆ int()

ILIAS\User\Profile\GUIRequest::int ( string  $key)
private

Definition at line 99 of file GUIRequest.php.

References ILIAS\User\Profile\GUIRequest\existsInPostOrQuery(), ILIAS\User\Profile\GUIRequest\getFromQueryOrPost(), and ILIAS\Repository\refinery().

Referenced by ILIAS\User\Profile\GUIRequest\getOsdId(), ILIAS\User\Profile\GUIRequest\getPrompted(), and ILIAS\User\Profile\GUIRequest\getUserId().

99  : int
100  {
101  $source = $this->existsInPostOrQuery($key);
102  if ($source === '') {
103  return 0;
104  }
105 
106  $transformation = $this->refinery->kindlyTo()->int();
107  return $this->getFromQueryOrPost($key, $transformation, $source);
108  }
getFromQueryOrPost(string $key, Transformation $transformation, string $source)
Definition: GUIRequest.php:147
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ str()

ILIAS\User\Profile\GUIRequest::str ( string  $key)
private

Definition at line 110 of file GUIRequest.php.

References ILIAS\User\Profile\GUIRequest\existsInPostOrQuery(), ILIAS\User\Profile\GUIRequest\getFromQueryOrPost(), and ILIAS\Repository\refinery().

Referenced by ILIAS\User\Profile\GUIRequest\getBackUrl(), ILIAS\User\Profile\GUIRequest\getBaseClass(), ILIAS\User\Profile\GUIRequest\getFieldId(), ILIAS\User\Profile\GUIRequest\getTerm(), ILIAS\User\Profile\GUIRequest\getToken(), and ILIAS\User\Profile\GUIRequest\getUserFileCapture().

110  : string
111  {
112  $source = $this->existsInPostOrQuery($key);
113  if ($source === '') {
114  return '';
115  }
116 
117  $transformation = $this->refinery->kindlyTo()->string();
118  return $this->getFromQueryOrPost($key, $transformation, $source);
119  }
getFromQueryOrPost(string $key, Transformation $transformation, string $source)
Definition: GUIRequest.php:147
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $post

array ILIAS\User\Profile\GUIRequest::$post
private

Definition at line 34 of file GUIRequest.php.

Referenced by ILIAS\User\Profile\GUIRequest\getParsedBody().

◆ $wrapper

WrapperFactory ILIAS\User\Profile\GUIRequest::$wrapper
private

Definition at line 30 of file GUIRequest.php.


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