3 declare(strict_types=1);
    47     public function sort(): self
    54             foreach ($this->
getItems() as $item) {
    55                 $link_id = $item->getLinkId();
    56                 $items_arr[$link_id][
'title'] = $item->getTitle();
    57                 $items_arr[$link_id][
'item'] = $item;
    67             foreach ($items_arr as $value) {
    68                 $result[] = $value[
'item'];
    70             $this->items = $result;
    73         $sorted = $unsorted = [];
    76             foreach ($this->
getItems() as $item) {
    77                 $link_id = $item->getLinkId();
    78                 if (isset($pos[$link_id])) {
    79                     $sorted[$link_id][
'title'] = $item->getTitle();
    80                     $sorted[$link_id][
'position'] = (
int) $pos[$link_id];
    81                     $sorted[$link_id][
'item'] = $item;
    83                     $unsorted[$link_id][
'title'] = $item->getTitle();
    84                     $unsorted[$link_id][
'item'] = $item;
    99             foreach ($sorted + $unsorted as $value) {
   100                 $result[] = $value[
'item'];
   102             $this->items = $result;
   121     protected function sortArray(array $array, 
string $sort_by_key, 
bool $numeric): array
   142         return $this->items[0] ?? null;
 __construct(int $webr_id, array $items=[])
 
static lookupPositions(int $a_obj_id)
 
static _lookupSortMode(int $a_obj_id)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
sortArray(array $array, string $sort_by_key, bool $numeric)
 
sort()
Sorts the items in this container according to the settings of this web link object. 
 
lookupManualPositions(int $webr_id)
 
__construct(Container $dic, ilPlugin $plugin)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
lookupSortMode(int $webr_id)
 
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)