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

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 class.ProfileGUIRequest.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 36 of file class.ProfileGUIRequest.php.

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

Member Function Documentation

◆ existsInPostOrQuery()

ILIAS\User\ProfileGUIRequest::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 class.ProfileGUIRequest.php.

Referenced by ILIAS\User\ProfileGUIRequest\int(), and ILIAS\User\ProfileGUIRequest\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  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the caller graph for this function:

◆ getBackUrl()

ILIAS\User\ProfileGUIRequest::getBackUrl ( )

Definition at line 53 of file class.ProfileGUIRequest.php.

References ILIAS\User\ProfileGUIRequest\str().

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

◆ getBaseClass()

ILIAS\User\ProfileGUIRequest::getBaseClass ( )

Definition at line 58 of file class.ProfileGUIRequest.php.

References ILIAS\User\ProfileGUIRequest\str().

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

◆ getFieldId()

ILIAS\User\ProfileGUIRequest::getFieldId ( )

Definition at line 73 of file class.ProfileGUIRequest.php.

References ILIAS\User\ProfileGUIRequest\str().

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

◆ getFromQueryOrPost()

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

Definition at line 147 of file class.ProfileGUIRequest.php.

Referenced by ILIAS\User\ProfileGUIRequest\int(), and ILIAS\User\ProfileGUIRequest\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  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the caller graph for this function:

◆ getOsdId()

ILIAS\User\ProfileGUIRequest::getOsdId ( )

Definition at line 68 of file class.ProfileGUIRequest.php.

References ILIAS\User\ProfileGUIRequest\int().

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

◆ getParsedBody()

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

Definition at line 125 of file class.ProfileGUIRequest.php.

References ILIAS\User\ProfileGUIRequest\$post.

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

◆ getPrompted()

ILIAS\User\ProfileGUIRequest::getPrompted ( )

Definition at line 63 of file class.ProfileGUIRequest.php.

References ILIAS\User\ProfileGUIRequest\int().

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

◆ getTerm()

ILIAS\User\ProfileGUIRequest::getTerm ( )

Definition at line 78 of file class.ProfileGUIRequest.php.

References ILIAS\User\ProfileGUIRequest\str().

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

◆ getToken()

ILIAS\User\ProfileGUIRequest::getToken ( )

Definition at line 83 of file class.ProfileGUIRequest.php.

References ILIAS\User\ProfileGUIRequest\str().

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

◆ getUserFileCapture()

ILIAS\User\ProfileGUIRequest::getUserFileCapture ( )

Definition at line 88 of file class.ProfileGUIRequest.php.

References ILIAS\User\ProfileGUIRequest\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\ProfileGUIRequest::getUserId ( )

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

References ILIAS\User\ProfileGUIRequest\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\ProfileGUIRequest::int ( string  $key)
private

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

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

Referenced by ILIAS\User\ProfileGUIRequest\getOsdId(), ILIAS\User\ProfileGUIRequest\getPrompted(), and ILIAS\User\ProfileGUIRequest\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  }
string $key
Consumer key/client ID value.
Definition: System.php:193
getFromQueryOrPost(string $key, Transformation $transformation, string $source)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ str()

ILIAS\User\ProfileGUIRequest::str ( string  $key)
private

Definition at line 110 of file class.ProfileGUIRequest.php.

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

Referenced by ILIAS\User\ProfileGUIRequest\getBackUrl(), ILIAS\User\ProfileGUIRequest\getBaseClass(), ILIAS\User\ProfileGUIRequest\getFieldId(), ILIAS\User\ProfileGUIRequest\getTerm(), ILIAS\User\ProfileGUIRequest\getToken(), and ILIAS\User\ProfileGUIRequest\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  }
string $key
Consumer key/client ID value.
Definition: System.php:193
getFromQueryOrPost(string $key, Transformation $transformation, string $source)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $post

array ILIAS\User\ProfileGUIRequest::$post
private

◆ $wrapper

WrapperFactory ILIAS\User\ProfileGUIRequest::$wrapper
private

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


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