ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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')
 
- 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_ids,
  $direction = 'asc' 
)

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

References array, and ilDclCache\getRecordFieldCache().

11  {
12  $sort_array = array();
13  foreach ($all_records_ids as $id) {
14  $formula_field = ilDclCache::getRecordFieldCache(new ilDclBaseRecordModel($id), $field);
15  $sort_array[$id] = $formula_field->getValue();
16  }
17  switch (strtolower($direction)) {
18  case 'asc':
19  asort($sort_array);
20  break;
21  case 'desc':
22  arsort($sort_array);
23  break;
24  }
25  return array_keys($sort_array);
26  }
Create styles array
The data for the language used.
static getRecordFieldCache($record, $field)
Class ilDclBaseRecordModel.
+ Here is the call graph for this function:

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