- $str = '';
- foreach ($joins as $key => $join) {
- if (! ($join instanceof PlSqlJoin)) {
- Platal::page()->kill("Error: not a join: $join");
- }
- $mode = $join->mode();
- $table = $join->table();
- $str .= ' ' . $mode . ' JOIN ' . $table . ' AS ' . $key;
- if ($join->condition() != null) {
- $str .= ' ON (' . $join->replaceJoinMetas($key, $joinMetas) . ')';
+ $sel = $this->getSortTokens($pf);
+ $this->_tokens = $sel;
+ if (!is_array($sel)) {
+ $sel = array($sel);
+ }
+ if ($this->desc) {
+ foreach ($sel as $k => $s) {
+ $sel[$k] = $s . ' DESC';