19declare(strict_types=1);
41 protected int $content_obj_id,
45 protected UIFactory $ui_factory,
47 protected DataFactory $data_factory
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) {
94 return count($this->getAllEligibleRefIDs());
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);
const string COL_ASSIGNED
buildPath(ReferenceId $ref_id)
sortRecords(array $records, Order $order)
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....
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...
__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)
Builds a Color from either hex- or rgb values.
Both the subject and the direction need to be specified when expressing an order.
A simple class to express a naive range of whole positive numbers.
Class ilObject Basic functions for all objects.
static _lookupType(int $id, bool $reference=false)
static _lookupTitle(int $obj_id)
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Util class various functions, usage as namespace.
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,...
buildDataRow(string $id, array $record)
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples