19 declare(strict_types=1);
41 protected int $content_obj_id,
53 array $visible_column_ids,
57 ?array $additional_parameters
61 $assigned = $this->grouping->getAssignedItems();
62 $assigned_ref_ids = [];
63 foreach ($assigned as $item) {
64 $assigned_ref_ids[] = $item[
'target_ref_id'];
67 $ok_icon = $this->ui_factory->symbol()->icon()->custom(
68 'assets/images/standard/icon_ok.svg',
69 $this->
lng->txt(
'assigned')
78 if (in_array($ref_id->toInt(), $assigned_ref_ids)) {
81 $records[$ref_id->toInt()] = $record;
87 foreach ($records as $ref_id => $record) {
88 yield $row_builder->
buildDataRow((
string) $ref_id, $record);
106 $this->
user->getId(),
110 $filtered_ref_ids = [];
111 foreach ($item_ref_ids as $item_ref_id) {
112 if ($this->tree->checkForParentType($item_ref_id,
'adm')) {
115 $filtered_ref_ids[] = $this->data_factory->refId($item_ref_id);
117 return $filtered_ref_ids;
123 foreach ($this->tree->getPathFull($ref_id->
toInt()) as $step) {
124 $titles[] = $step[
'title'];
126 return implode(
' > ', $titles);
132 $order_direction = $order->
get()[$order_field] ??
Order::ASC;
134 $ordering_callable_without_direction = match ($order_field) {
136 fn(
$a,
$b) =>
$a[$order_field] ??
'' <=>
$b[$order_field] ??
'',
138 fn(
$a,
$b) => isset(
$a[$order_field]) <=> isset(
$b[$order_field])
140 $ordering_callable = fn(
$a,
$b) => $order_direction ===
Order::ASC ?
141 $ordering_callable_without_direction(
$a,
$b) :
142 $ordering_callable_without_direction(
$b,
$a);
144 uasort($records, $ordering_callable);
buildPath(ReferenceId $ref_id)
Both the subject and the direction need to be specified when expressing an order. ...
buildDataRow(string $id, array $record)
sortRecords(array $records, Order $order)
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
static _getObjectsByOperations( $a_obj_type, string $a_operation, int $a_usr_id=0, int $limit=0)
Get all objects of a specific type and check access This function is not recursive, instead it parses the serialized rbac_pa entries.
const string COL_ASSIGNED
getTotalRowCount(?array $filter_data, ?array $additional_parameters)
Mainly for the purpose of pagination-support, it is important to know about the total number of recor...
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
__construct(protected int $content_obj_id, protected ilObjCourseGrouping $grouping, protected ilObjUser $user, protected ilTree $tree, protected UIFactory $ui_factory, protected ilLanguage $lng, protected DataFactory $data_factory)
static _lookupType(int $id, bool $reference=false)
A simple class to express a naive range of whole positive numbers.