/** * Modifies the query criteria by changing its {@link CDbCriteria::order} property. * This method will use {@link directions} to determine which columns need to be sorted. * They will be put in the ORDER BY clause. If the criteria already has non-empty {@link CDbCriteria::order} value, * the new value will be appended to it. * @param MongoDbCriteria $criteria the query criteria */ public function applyOrder($criteria) { if (!isset($_GET[$this->sortVar])) { return; } $temp = explode('.', $_GET[$this->sortVar]); $field = $temp[0]; if (isset($temp[1]) && $temp[1] == self::SORT_ASC) { $arrow = 'ASC'; } else { if (isset($temp[1]) && $temp[1] == self::SORT_DESC) { $arrow = 'DESC'; } else { $arrow = 'ASC'; } } $criteria->orderBy($field, $arrow, $this->multiSort); }