示例#1
0
文件: Grid.php 项目: peterzadori/movi
 private function sort(IDataSource $dataSource)
 {
     if ($this->sorting === NULL) {
         $this->sorting = $this->defaultSorting;
     }
     if ($this->sorting === NULL) {
         return;
     }
     // Check column
     list($column) = $this->sorting;
     if ($column != $this->primaryKey) {
         $column = $this['columns'][$column];
         if (!$column->isSortable()) {
             throw new InvalidArgumentException("Column '{$column->name}' is not sortable");
         }
         $column->setSorting();
     }
     $dataSource->sort($this->sorting);
 }