ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 $id, array, and ilDclCache\getRecordFieldCache().

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  return array_keys($sort_array);
27  }
if(!array_key_exists('StateId', $_REQUEST)) $id
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: