ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilDclFormulaRecordQueryObject Class Reference

Class ilDclFormulaRecordQueryObject. More...

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

Public Member Functions

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

Additional Inherited Members

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

Detailed Description

Member Function Documentation

◆ applyCustomSorting()

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

Apply custom sorting.

Parameters
ilDclBaseFieldModel$field
array$all_records
string$direction
Returns
array

Reimplemented from ilDclRecordQueryObject.

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

12 {
13 $sort_array = array();
14 foreach ($all_records_ids as $id) {
15 $formula_field = ilDclCache::getRecordFieldCache(new ilDclBaseRecordModel($id), $field);
16 $sort_array[$id] = $formula_field->getValue();
17 }
18 switch (strtolower($direction)) {
19 case 'asc':
20 asort($sort_array);
21 break;
22 case 'desc':
23 arsort($sort_array);
24 break;
25 }
26
27 return array_keys($sort_array);
28 }
Class ilDclBaseRecordModel.
static getRecordFieldCache($record, $field)
if(!array_key_exists('StateId', $_REQUEST)) $id

References $id, and ilDclCache\getRecordFieldCache().

+ Here is the call graph for this function:

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