ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilDclTextRecordQueryObject.php
Go to the documentation of this file.
1 <?php
2 
20 {
21  public function applyCustomSorting(ilDclBaseFieldModel $field, array $all_records, $direction = 'asc'): array
22  {
23  $sort_array = array();
24  foreach ($all_records as $id) {
25  $url_field = ilDclCache::getRecordFieldCache(new ilDclBaseRecordModel($id), $field);
26  $sort_array[$id] = $url_field->getSortingValue();
27  }
28  switch (strtolower($direction)) {
29  case 'asc':
30  asort($sort_array);
31  break;
32  case 'desc':
33  arsort($sort_array);
34  break;
35  }
36 
37  return array_keys($sort_array);
38  }
39 }
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static getRecordFieldCache(object $record, object $field)
applyCustomSorting(ilDclBaseFieldModel $field, array $all_records, $direction='asc')