ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDclFormulaRecordQueryObject Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilDclFormulaRecordQueryObject:
+ Collaboration diagram for ilDclFormulaRecordQueryObject:

Public Member Functions

 applyCustomSorting (ilDclBaseFieldModel $field, array $all_records, string $direction='asc')
 
- Public Member Functions inherited from ilDclRecordQueryObject
 getSelectStatement ()
 
 setSelectStatement (string $selectStatement)
 
 getJoinStatement ()
 
 setJoinStatement (string $joinStatement)
 
 getWhereStatement ()
 
 setWhereStatement (string $whereStatement)
 
 getGroupStatement ()
 
 setGroupStatement (string $groupStatement)
 
 getOrderStatement ()
 
 setOrderStatement (string $orderStatement)
 
 applyCustomSorting (ilDclBaseFieldModel $field, array $all_records, string $direction='asc')
 Apply custom sorting. More...
 

Additional Inherited Members

- Protected Attributes inherited from ilDclRecordQueryObject
string $selectStatement = ""
 
string $joinStatement = ""
 
string $whereStatement = ""
 
string $groupStatement = ""
 
string $orderStatement = ""
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 19 of file class.ilDclFormulaRecordQueryObject.php.

Member Function Documentation

◆ applyCustomSorting()

ilDclFormulaRecordQueryObject::applyCustomSorting ( ilDclBaseFieldModel  $field,
array  $all_records,
string  $direction = 'asc' 
)

Definition at line 21 of file class.ilDclFormulaRecordQueryObject.php.

References $id, and ilDclCache\getRecordFieldCache().

25  : array {
26  $sort_array = array();
27  foreach ($all_records as $id) {
28  $formula_field = ilDclCache::getRecordFieldCache(new ilDclBaseRecordModel($id), $field);
29  $sort_array[$id] = $formula_field->getValue();
30  }
31  switch (strtolower($direction)) {
32  case 'asc':
33  asort($sort_array);
34  break;
35  case 'desc':
36  arsort($sort_array);
37  break;
38  }
39 
40  return array_keys($sort_array);
41  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static getRecordFieldCache(object $record, object $field)
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: