ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilDclFormulaRecordQueryObject Class Reference
+ Inheritance diagram for ilDclFormulaRecordQueryObject:
+ Collaboration diagram for ilDclFormulaRecordQueryObject:

Public Member Functions

 applyCustomSorting (ilDclBaseFieldModel $field, array $all_records, string $direction='asc')
 Apply custom sorting. More...
 
- 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' 
)

Apply custom sorting.

Reimplemented from ilDclRecordQueryObject.

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

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)

References $id, and ilDclCache\getRecordFieldCache().

+ Here is the call graph for this function:

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