ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilDclFormulaRecordQueryObject Class Reference
+ 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

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

Member Function Documentation

◆ applyCustomSorting()

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

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

References $id, and ilDclCache\getRecordFieldCache().

27  : array {
28  $sort_array = [];
29  foreach ($all_records as $id) {
30  $formula_field = ilDclCache::getRecordFieldCache(new ilDclBaseRecordModel($id), $field);
31  $sort_array[$id] = $formula_field->getValue();
32  }
33  switch (strtolower($direction)) {
34  case 'asc':
35  asort($sort_array);
36  break;
37  case 'desc':
38  arsort($sort_array);
39  break;
40  }
41 
42  return array_keys($sort_array);
43  }
$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: