ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ILIAS\Test\Settings\Templates\PersonalSettingsTable Class Reference
+ Inheritance diagram for ILIAS\Test\Settings\Templates\PersonalSettingsTable:
+ Collaboration diagram for ILIAS\Test\Settings\Templates\PersonalSettingsTable:

Public Member Functions

 __construct (private readonly Language $lng, private readonly UIFactory $ui_factory, private readonly DataFactory $data_factory, private readonly \ilObjUser $user, private readonly RequestDataCollector $test_request, private readonly PersonalSettingsTableActions $table_actions, private readonly URLBuilder $url_builder, private readonly PersonalSettingsRepository $repository,)
 
 perform ()
 
 getComponent ()
 
 getRows (DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 
 getTotalRowCount (mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 Mainly for the purpose of pagination-support, it is important to know about the total number of records available. More...
 
 getRows (DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 This is called by the table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 
 getTotalRowCount (mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
 Mainly for the purpose of pagination-support, it is important to know about the total number of records available. More...
 

Private Member Functions

 acquireParameters ()
 
 getColumns ()
 

Private Attributes

const string ID = 'pst'
 

Detailed Description

Definition at line 37 of file PersonalSettingsTable.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Test\Settings\Templates\PersonalSettingsTable::__construct ( private readonly Language  $lng,
private readonly UIFactory  $ui_factory,
private readonly DataFactory  $data_factory,
private readonly \ilObjUser  $user,
private readonly RequestDataCollector  $test_request,
private readonly PersonalSettingsTableActions  $table_actions,
private readonly URLBuilder  $url_builder,
private readonly PersonalSettingsRepository  $repository 
)

Definition at line 41 of file PersonalSettingsTable.php.

50 {
51 }

Member Function Documentation

◆ acquireParameters()

◆ getColumns()

ILIAS\Test\Settings\Templates\PersonalSettingsTable::getColumns ( )
private
Returns
array<string, Column>

Definition at line 71 of file PersonalSettingsTable.php.

71 : array
72 {
73 $column_factory = $this->ui_factory->table()->column();
74
75 return [
76 'name' => $column_factory->text($this->lng->txt('personal_settings_name')),
77 'description' => $column_factory->text($this->lng->txt('personal_settings_description'))->withIsSortable(false),
78 'tstamp' => $column_factory->date($this->lng->txt('personal_settings_timestamp'), $this->user->getDateTimeFormat()),
79 'author' => $column_factory->text($this->lng->txt('personal_settings_author'))
80 ];
81 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getComponent()

ILIAS\Test\Settings\Templates\PersonalSettingsTable::getComponent ( )

Definition at line 83 of file PersonalSettingsTable.php.

83 : DataTable
84 {
85 return $this->ui_factory->table()
86 ->data($this, $this->lng->txt('personal_settings_templates_available'), $this->getColumns())
87 ->withRequest($this->test_request->getRequest())
88 ->withActions($this->table_actions->getActions(...$this->acquireParameters()))
89 ->withOrder(new Order('tstamp', Order::DESC))
90 ->withId(self::ID);
91 }
Both the subject and the direction need to be specified when expressing an order.
Definition: Order.php:29
const DESC
Definition: Order.php:31

References ILIAS\Data\Order\DESC, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getRows()

ILIAS\Test\Settings\Templates\PersonalSettingsTable::getRows ( DataRowBuilder  $row_builder,
array  $visible_column_ids,
Range  $range,
Order  $order,
mixed  $additional_viewcontrol_data,
mixed  $filter_data,
mixed  $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 93 of file PersonalSettingsTable.php.

101 : Generator {
102 foreach ($this->repository->getForUser($range, $order) as $template) {
103 $row = [
104 'name' => $template->getName(),
105 'tstamp' => $template->getCreatedAt(),
106 'description' => $template->getDescription(),
107 'author' => $template->getAuthor(),
108 ];
109
110 yield $row_builder->buildDataRow((string) $template->getId(), $row);
111 }
112 }
buildDataRow(string $id, array $record)

References ILIAS\UI\Component\Table\DataRowBuilder\buildDataRow().

+ Here is the call graph for this function:

◆ getTotalRowCount()

ILIAS\Test\Settings\Templates\PersonalSettingsTable::getTotalRowCount ( mixed  $additional_viewcontrol_data,
mixed  $filter_data,
mixed  $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 114 of file PersonalSettingsTable.php.

118 : ?int {
119 return $this->repository->countForUser();
120 }

◆ perform()

ILIAS\Test\Settings\Templates\PersonalSettingsTable::perform ( )

Definition at line 53 of file PersonalSettingsTable.php.

53 : ?Modal
54 {
55 return $this->table_actions->perform(...$this->acquireParameters());
56 }

References ILIAS\Test\Settings\Templates\PersonalSettingsTable\acquireParameters().

+ Here is the call graph for this function:

Field Documentation

◆ ID

const string ILIAS\Test\Settings\Templates\PersonalSettingsTable::ID = 'pst'
private

Definition at line 39 of file PersonalSettingsTable.php.


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