ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Test\Questions\RandomQuestionSetNonAvailablePoolsTable Class Reference
+ Inheritance diagram for ILIAS\Test\Questions\RandomQuestionSetNonAvailablePoolsTable:
+ Collaboration diagram for ILIAS\Test\Questions\RandomQuestionSetNonAvailablePoolsTable:

Public Member Functions

 __construct (protected readonly \ilCtrlInterface $ctrl, protected readonly \ilLanguage $lng, protected readonly UIFactory $ui_factory, protected readonly DataFactory $data_factory, protected readonly ServerRequestInterface $request, protected readonly PoolDefinitionList $pool_definition_list)
 
 getRows (DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, ?array $filter_data, ?array $additional_parameters)
 This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 
 getTotalRowCount (?array $filter_data, ?array $additional_parameters)
 Mainly for the purpose of pagination-support, it is important to know about the total number of records available. More...
 
 getComponent ()
 
 getRows (DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, ?array $filter_data, ?array $additional_parameters)
 This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 
 getTotalRowCount (?array $filter_data, ?array $additional_parameters)
 Mainly for the purpose of pagination-support, it is important to know about the total number of records available. More...
 

Protected Member Functions

 getData (Range $range, Order $order)
 
 getColumns ()
 
 getActions ()
 

Detailed Description

Definition at line 38 of file RandomQuestionSetNonAvailablePoolsTable.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Questions\RandomQuestionSetNonAvailablePoolsTable::__construct ( protected readonly \ilCtrlInterface  $ctrl,
protected readonly \ilLanguage  $lng,
protected readonly UIFactory  $ui_factory,
protected readonly DataFactory  $data_factory,
protected readonly ServerRequestInterface  $request,
protected readonly PoolDefinitionList  $pool_definition_list 
)

Definition at line 40 of file RandomQuestionSetNonAvailablePoolsTable.php.

47 {
48 }

Member Function Documentation

◆ getActions()

ILIAS\Test\Questions\RandomQuestionSetNonAvailablePoolsTable::getActions ( )
protected
Returns
array<string, Action>

Definition at line 109 of file RandomQuestionSetNonAvailablePoolsTable.php.

109 : array
110 {
111 $target = $this->data_factory->uri((string) $this->request->getUri());
112 $url_builder = new URLBuilder($target);
113 [$url_builder, $id_token] = $url_builder->acquireParameters(
114 ['derive_pool'],
115 'ids'
116 );
117 return [
118 'derive_pool' => $this->ui_factory->table()->action()->single(
119 $this->lng->txt('tst_derive_new_pool'),
120 $url_builder->withURI($target->withParameter('cmd', ConfigGUI::CMD_SELECT_DERIVATION_TARGET)),
121 $id_token
122 )
123 ];
124 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getColumns()

ILIAS\Test\Questions\RandomQuestionSetNonAvailablePoolsTable::getColumns ( )
protected
Returns
array<string, Column>

Definition at line 96 of file RandomQuestionSetNonAvailablePoolsTable.php.

96 : array
97 {
98 $column_factory = $this->ui_factory->table()->column();
99 return [
100 'title' => $column_factory->text($this->lng->txt('title')),
101 'path' => $column_factory->text($this->lng->txt('path')),
102 'status' => $column_factory->text($this->lng->txt('status')),
103 ];
104 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getComponent()

ILIAS\Test\Questions\RandomQuestionSetNonAvailablePoolsTable::getComponent ( )

Definition at line 84 of file RandomQuestionSetNonAvailablePoolsTable.php.

84 : DataTable
85 {
86 return $this->ui_factory->table()
87 ->data($this, $this->lng->txt('tst_non_avail_pools_table'), $this->getColumns())
88 ->withRequest($this->request)
89 ->withActions($this->getActions())
90 ->withId('tst_non_avail_pools_table');
91 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getData()

ILIAS\Test\Questions\RandomQuestionSetNonAvailablePoolsTable::getData ( Range  $range,
Order  $order 
)
protected

Definition at line 73 of file RandomQuestionSetNonAvailablePoolsTable.php.

73 : array
74 {
75 $data = array_map(fn($pool) => [
76 'id' => $pool->getId(),
77 'title' => $pool->getTitle(),
78 'path' => $pool->getPath(),
79 'status' => $pool->getUnavailabilityStatus(),
80 ], $this->pool_definition_list->getNonAvailablePools());
81 return array_slice($data, $range->getStart(), $range->getLength());
82 }

References $data, ILIAS\UI\Implementation\Component\Table\$range, ILIAS\Data\Range\getLength(), and ILIAS\Data\Range\getStart().

+ Here is the call graph for this function:

◆ getRows()

ILIAS\Test\Questions\RandomQuestionSetNonAvailablePoolsTable::getRows ( DataRowBuilder  $row_builder,
array  $visible_column_ids,
Range  $range,
Order  $order,
?array  $filter_data,
?array  $additional_parameters 
)

This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g.

yield $row_builder->buildStandardRow($row_id, $record).

Parameters
string[]$visible_column_ids

Implements ILIAS\UI\Component\Table\DataRetrieval.

Definition at line 50 of file RandomQuestionSetNonAvailablePoolsTable.php.

57 : Generator {
58 foreach ($this->getData($range, $order) as $record) {
60
61 $record['status'] = $this->lng->txt('tst_non_avail_pool_msg_status_' . $record['status']);
62 yield $row_builder
63 ->buildDataRow((string) $record['id'], $record)
64 ->withDisabledAction('derive_pool', !$derive);
65 }
66 }
buildDataRow(string $id, array $record)

References ILIAS\UI\Component\Table\DataRowBuilder\buildDataRow(), ILIAS\Repository\lng(), and ilTestRandomQuestionSetNonAvailablePool\UNAVAILABILITY_STATUS_LOST.

+ Here is the call graph for this function:

◆ getTotalRowCount()

ILIAS\Test\Questions\RandomQuestionSetNonAvailablePoolsTable::getTotalRowCount ( ?array  $filter_data,
?array  $additional_parameters 
)

Mainly for the purpose of pagination-support, it is important to know about the total number of records available.

Given the nature of a DataTable, which is, opposite to a PresentationTable, rather administrative than explorative, this information will increase user experience quite a bit. However, you may return null, if the call is to costly, but expect the View Control to look a little different in this case.

Make sure that potential filters or user restrictions are being applied to the count.

Implements ILIAS\UI\Component\Table\DataRetrieval.

Definition at line 68 of file RandomQuestionSetNonAvailablePoolsTable.php.

68 : ?int
69 {
70 return count($this->pool_definition_list->getNonAvailablePools());
71 }

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