ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Rating\RatingCategoryOrderingTable Class Reference
+ Inheritance diagram for ILIAS\Rating\RatingCategoryOrderingTable:
+ Collaboration diagram for ILIAS\Rating\RatingCategoryOrderingTable:

Public Member Functions

 __construct (private readonly int $parent_obj_id, private readonly Factory $ui_factory, private readonly ilLanguage $lng, private readonly ilCtrlInterface $ctrl, private readonly DataFactory $data_factory, private readonly ServerRequestInterface $httpRequest,)
 
 getComponent ()
 
 getActions (URLBuilder $url_builder, URLBuilderToken $action_parameter_token, URLBuilderToken $row_id_token)
 
 getRows (OrderingRowBuilder $row_builder, array $visible_column_ids,)
 This is called by the (ordering-)table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 
 initRecords ()
 
 getTotalRowCount (?array $filter_data, ?array $additional_parameters)
 
 getRows (OrderingRowBuilder $row_builder, array $visible_column_ids)
 This is called by the (ordering-)table to retrieve rows; map data-records to rows using the $row_builder e.g. More...
 

Private Member Functions

 getColumns ()
 

Private Attributes

array $records = null
 

Detailed Description

Definition at line 37 of file RatingCategoryOrderingTable.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Rating\RatingCategoryOrderingTable::__construct ( private readonly int  $parent_obj_id,
private readonly Factory  $ui_factory,
private readonly ilLanguage  $lng,
private readonly ilCtrlInterface  $ctrl,
private readonly DataFactory  $data_factory,
private readonly ServerRequestInterface  $httpRequest 
)

Definition at line 41 of file RatingCategoryOrderingTable.php.

48 {
49 }

Member Function Documentation

◆ getActions()

ILIAS\Rating\RatingCategoryOrderingTable::getActions ( URLBuilder  $url_builder,
URLBuilderToken  $action_parameter_token,
URLBuilderToken  $row_id_token 
)

Definition at line 85 of file RatingCategoryOrderingTable.php.

89 : array {
90 return [
91 'edit' => $this->ui_factory->table()->action()->single(
92 $this->lng->txt('edit'),
93 $url_builder->withParameter($action_parameter_token, 'edit'),
94 $row_id_token
95 ),
96 'delete' => $this->ui_factory->table()->action()->single(
97 $this->lng->txt('delete'),
98 $url_builder->withParameter($action_parameter_token, 'confirmDelete'),
99 $row_id_token
100 )
101 ];
102 }
withParameter(URLBuilderToken $token, string|array $value)
Change an acquired parameter's value if the supplied token is valid.
Definition: URLBuilder.php:166

Referenced by ILIAS\Rating\RatingCategoryOrderingTable\getComponent().

+ Here is the caller graph for this function:

◆ getColumns()

ILIAS\Rating\RatingCategoryOrderingTable::getColumns ( )
private
Returns
array{ title: \ILIAS\UI\Component\Table\Column\Text, description: \ILIAS\UI\Component\Table\Column\Text }

Definition at line 127 of file RatingCategoryOrderingTable.php.

127 : array
128 {
129 return [
130 'title' => $this->ui_factory->table()->column()->text($this->lng->txt('title')),
131 'description' => $this->ui_factory->table()->column()->text($this->lng->txt('description'))
132 ];
133 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getComponent()

ILIAS\Rating\RatingCategoryOrderingTable::getComponent ( )

Definition at line 51 of file RatingCategoryOrderingTable.php.

51 : Ordering
52 {
53 $query_params_namespace = ['rating', 'category', 'ordering'];
54 $uri = $this->data_factory->uri(
55 ILIAS_HTTP_PATH . '/' . $this->ctrl->getLinkTargetByClass(ilRatingCategoryGUI::class, 'handleTableActions')
56 );
57 $url_builder = new URLBuilder($uri);
58 [$url_builder, $action_parameter_token, $row_id_token] = $url_builder->acquireParameters(
59 $query_params_namespace,
60 'table_action',
61 'rating_ids'
62 );
63
64 return $this->ui_factory
65 ->table()
66 ->ordering(
67 $this,
68 $uri->withParameter('cmd', 'updateOrder'),
69 $this->lng->txt('rating_categories'),
70 $this->getColumns(),
71 )
72 ->withId(
73 'rating_category_ordering_table'
74 )
75 ->withRequest($this->httpRequest)
76 ->withActions(
77 $this->getActions(
78 $url_builder,
79 $action_parameter_token,
80 $row_id_token
81 )
82 );
83 }
getActions(URLBuilder $url_builder, URLBuilderToken $action_parameter_token, URLBuilderToken $row_id_token)

References ILIAS\Repository\ctrl(), and ILIAS\Rating\RatingCategoryOrderingTable\getActions().

+ Here is the call graph for this function:

◆ getRows()

ILIAS\Rating\RatingCategoryOrderingTable::getRows ( OrderingRowBuilder  $row_builder,
array  $visible_column_ids 
)

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

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

Implements ILIAS\UI\Component\Table\OrderingRetrieval.

Definition at line 104 of file RatingCategoryOrderingTable.php.

107 : Generator {
108 $this->initRecords();
109 foreach ($this->records as $record) {
110 yield $row_builder->buildOrderingRow((string) $record['id'], $record);
111 }
112 }
buildOrderingRow(string $id, array $record)

References ILIAS\UI\Component\Table\OrderingRowBuilder\buildOrderingRow().

+ Here is the call graph for this function:

◆ getTotalRowCount()

ILIAS\Rating\RatingCategoryOrderingTable::getTotalRowCount ( ?array  $filter_data,
?array  $additional_parameters 
)

Definition at line 135 of file RatingCategoryOrderingTable.php.

135 : ?int
136 {
137 $this->initRecords();
138
139 return count($this->records);
140 }

◆ initRecords()

ILIAS\Rating\RatingCategoryOrderingTable::initRecords ( )

Definition at line 114 of file RatingCategoryOrderingTable.php.

114 : void
115 {
116 if (!$this->records) {
117 $this->records = ilRatingCategory::getAllForObject($this->parent_obj_id);
118 }
119 }
static getAllForObject(int $a_parent_obj_id)

References ilRatingCategory\getAllForObject().

+ Here is the call graph for this function:

Field Documentation

◆ $records

array ILIAS\Rating\RatingCategoryOrderingTable::$records = null
private

Definition at line 39 of file RatingCategoryOrderingTable.php.


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