19 declare(strict_types=1);
42 protected int $content_obj_id,
52 array $visible_column_ids,
56 ?array $additional_parameters
61 foreach ($grouping_ids as $grouping_id) {
75 $condition_ref_ids = [];
76 foreach ($grouping->getAssignedItems() as $condition) {
77 $condition_ref_ids[] = $condition[
'target_ref_id'];
81 $records[$grouping->getId()] = $record;
87 foreach ($records as
$id => $record) {
107 $ref_id = $this->data_factory->refId($ref_id);
111 $link = $this->static_url->builder()->build($type, $ref_id);
112 return $this->ui_factory->link()->standard($title, (
string) $link);
120 foreach ($ref_ids as
$ref_id) {
122 if ($link !==
null) {
126 return $this->ui_factory->listing()->unordered($links);
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] ??
'',
143 $a_first_item_label = ($a_items[0] ??
null)?->
getLabel() ??
'';
144 $b_first_item_label = ($b_items[0] ??
null)?->
getLabel() ??
'';
145 return $a_first_item_label <=> $b_first_item_label;
148 $ordering_callable = fn(
$a,
$b) => $order_direction ===
Order::ASC ?
149 $ordering_callable_without_direction(
$a,
$b) :
150 $ordering_callable_without_direction(
$b,
$a);
152 uasort($records, $ordering_callable);
user()
description: > Example for rendering a user card
sortRecords(array $records, Order $order)
const string COL_ASSIGNED_OBJS
static _getVisibleGroupings(int $a_obj_id)
Returns a list of all groupings for which the current user hast write permission on all assigned obje...
const string COL_DESCRIPTION
const string COL_UNIQUE_FIELD
Both the subject and the direction need to be specified when expressing an order. ...
buildDataRow(string $id, array $record)
buildLinkToObject(int $ref_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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...
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(protected int $content_obj_id, protected ilLanguage $lng, protected UIFactory $ui_factory, protected DataFactory $data_factory, protected StaticURL $static_url)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
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 _lookupType(int $id, bool $reference=false)
A simple class to express a naive range of whole positive numbers.
buildLinkListing(int ... $ref_ids)