ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Test\Questions\Presentation\QuestionsTableQuery Class Reference
+ Inheritance diagram for ILIAS\Test\Questions\Presentation\QuestionsTableQuery:
+ Collaboration diagram for ILIAS\Test\Questions\Presentation\QuestionsTableQuery:

Public Member Functions

 __construct (HTTPService $http, protected Refinery $refinery, protected DataFactory $data_factory, array $namespace)
 
 getTableAction ()
 
 getRowIds (\ilObjTest $obj_test)
 
 getPrintViewType ()
 
 getActionURL (string $action)
 
 getPrintViewTypeURL (string $action, string $type)
 
 getRowBoundURLBuilder (string $action)
 

Protected Attributes

ServerRequestInterface $request
 
RequestWrapper $request_wrapper
 
URLBuilder $url_builder
 
URLBuilderToken $action_token
 
URLBuilderToken $row_id_token
 
URLBuilderToken $print_view_type_token
 

Private Member Functions

 getUrlBuilder ()
 
 retrieveStringOrNull (URLBuilderToken $token)
 

Detailed Description

Definition at line 32 of file QuestionsTableQuery.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Questions\Presentation\QuestionsTableQuery::__construct ( HTTPService  $http,
protected Refinery  $refinery,
protected DataFactory  $data_factory,
array  $namespace 
)

Definition at line 41 of file QuestionsTableQuery.php.

References ILIAS\Test\Questions\Presentation\QuestionsTableQuery\getUrlBuilder().

46  {
47  $this->request = $http->request();
48  $this->request_wrapper = $http->wrapper()->query();
49 
50  list(
51  $this->url_builder,
52  $this->action_token,
53  $this->row_id_token,
54  $this->print_view_type_token
55  ) = $this->getUrlBuilder()->acquireParameters(
56  $namespace,
57  'action',
58  'ids',
59  'print_view_type'
60  );
61  }
if($err=$client->getError()) $namespace
$http
Definition: deliver.php:30
+ Here is the call graph for this function:

Member Function Documentation

◆ getActionURL()

ILIAS\Test\Questions\Presentation\QuestionsTableQuery::getActionURL ( string  $action)

Definition at line 110 of file QuestionsTableQuery.php.

110  : URI
111  {
112  return $this->url_builder->withParameter(
113  $this->action_token,
114  $action
115  )->buildURI();
116  }

◆ getPrintViewType()

ILIAS\Test\Questions\Presentation\QuestionsTableQuery::getPrintViewType ( )

Definition at line 99 of file QuestionsTableQuery.php.

References ILIAS\Repository\refinery().

99  : string
100  {
101  if (!$this->request_wrapper->has($this->print_view_type_token->getName())) {
102  return '';
103  }
104  return $this->request_wrapper->retrieve(
105  $this->print_view_type_token->getName(),
106  $this->refinery->kindlyTo()->string()
107  );
108  }
+ Here is the call graph for this function:

◆ getPrintViewTypeURL()

ILIAS\Test\Questions\Presentation\QuestionsTableQuery::getPrintViewTypeURL ( string  $action,
string  $type 
)

Definition at line 118 of file QuestionsTableQuery.php.

References ILIAS\Repository\refinery().

121  : URI {
122  return $this->url_builder->withParameter(
123  $this->action_token,
124  $action
125  )->withParameter(
126  $this->print_view_type_token,
127  $type
128  )->withParameter(
129  $this->row_id_token,
130  $this->request_wrapper->retrieve(
131  $this->row_id_token->getName(),
132  $this->refinery->identity()
133  )
134  )->buildURI();
135  }
+ Here is the call graph for this function:

◆ getRowBoundURLBuilder()

ILIAS\Test\Questions\Presentation\QuestionsTableQuery::getRowBoundURLBuilder ( string  $action)

Definition at line 137 of file QuestionsTableQuery.php.

References ILIAS\Test\Questions\Presentation\QuestionsTableQuery\$row_id_token.

137  : array
138  {
139  return [
140  $this->url_builder->withParameter($this->action_token, $action),
142  ];
143  }

◆ getRowIds()

ILIAS\Test\Questions\Presentation\QuestionsTableQuery::getRowIds ( \ilObjTest  $obj_test)

Definition at line 77 of file QuestionsTableQuery.php.

References ilObjTest\getTestQuestions(), null, and ILIAS\Repository\refinery().

Referenced by ilObjTestGUI\getTargetQuestionpoolForm(), and ilObjTestGUI\showQuestionsObject().

77  : ?array
78  {
79  if ($this->request_wrapper->retrieve(
80  $this->row_id_token->getName(),
81  $this->refinery->identity()
82  ) === ['ALL_OBJECTS']) {
83  return array_map(
84  fn($record) => $record['question_id'],
85  $obj_test->getTestQuestions()
86  );
87  }
88  return $this->request_wrapper->retrieve(
89  $this->row_id_token->getName(),
90  $this->refinery->kindlyTo()->listOf(
91  $this->refinery->byTrying([
92  $this->refinery->kindlyTo()->int(),
93  $this->refinery->always(null)
94  ])
95  )
96  );
97  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTableAction()

ILIAS\Test\Questions\Presentation\QuestionsTableQuery::getTableAction ( )

Definition at line 72 of file QuestionsTableQuery.php.

References ILIAS\Test\Questions\Presentation\QuestionsTableQuery\retrieveStringOrNull().

Referenced by ilObjTestGUI\getTargetQuestionpoolForm(), and ilObjTestGUI\showQuestionsObject().

72  : ?string
73  {
74  return $this->retrieveStringOrNull($this->action_token);
75  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUrlBuilder()

ILIAS\Test\Questions\Presentation\QuestionsTableQuery::getUrlBuilder ( )
private

Definition at line 63 of file QuestionsTableQuery.php.

Referenced by ILIAS\Test\Questions\Presentation\QuestionsTableQuery\__construct().

63  : URLBuilder
64  {
65  return new URLBuilder(
66  $this->data_factory->uri(
67  $this->request->getUri()->__toString()
68  )
69  );
70  }
+ Here is the caller graph for this function:

◆ retrieveStringOrNull()

ILIAS\Test\Questions\Presentation\QuestionsTableQuery::retrieveStringOrNull ( URLBuilderToken  $token)
private

Definition at line 145 of file QuestionsTableQuery.php.

References ILIAS\UI\URLBuilderToken\getName(), null, and ILIAS\Repository\refinery().

Referenced by ILIAS\Test\Questions\Presentation\QuestionsTableQuery\getTableAction().

145  : ?string
146  {
147  return $this->request_wrapper->retrieve(
148  $token->getName(),
149  $this->refinery->custom()->transformation(
150  function (?string $v): ?string {
151  if ($v === null) {
152  return null;
153  }
154  $tv = $this->refinery->kindlyTo()->string()->transform($v);
155  if ($tv === '') {
156  return null;
157  }
158  return $tv;
159  }
160  )
161  );
162  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$token
Definition: xapitoken.php:70
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $action_token

URLBuilderToken ILIAS\Test\Questions\Presentation\QuestionsTableQuery::$action_token
protected

Definition at line 37 of file QuestionsTableQuery.php.

◆ $print_view_type_token

URLBuilderToken ILIAS\Test\Questions\Presentation\QuestionsTableQuery::$print_view_type_token
protected

Definition at line 39 of file QuestionsTableQuery.php.

◆ $request

ServerRequestInterface ILIAS\Test\Questions\Presentation\QuestionsTableQuery::$request
protected

Definition at line 34 of file QuestionsTableQuery.php.

◆ $request_wrapper

RequestWrapper ILIAS\Test\Questions\Presentation\QuestionsTableQuery::$request_wrapper
protected

Definition at line 35 of file QuestionsTableQuery.php.

◆ $row_id_token

URLBuilderToken ILIAS\Test\Questions\Presentation\QuestionsTableQuery::$row_id_token
protected

◆ $url_builder

URLBuilder ILIAS\Test\Questions\Presentation\QuestionsTableQuery::$url_builder
protected

Definition at line 36 of file QuestionsTableQuery.php.


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