示例#1
0
文件: Table.php 项目: pracj3am/osto
 /**
  * Selects columns to order by.
  * @param  string|array|Table\Column  column name or array of column names
  * @param  string        sorting direction
  * @return Table         provides a fluent interface
  */
 public function orderBy($col, $sorting = 'ASC')
 {
     if (\is_array($col)) {
         $col2 = array();
         foreach ($col as $k => $c) {
             $col2[$this->_translateColumns($k)] = $this->_translateColumns((string) $c);
         }
         unset($col);
         $col = $col2;
     } else {
         $col = $this->_translateColumns((string) $col);
     }
     $this->dataSource->orderBy($this->_translateColumns($col), $sorting);
     return $this;
 }