Bluz\Grid\Grid::addOrder PHP Method

addOrder() public method

Add order rule
public addOrder ( string $column, string $order = Grid::ORDER_ASC ) : void
$column string
$order string
return void
    public function addOrder($column, $order = Grid::ORDER_ASC)
    {
        if (!in_array($column, $this->allowOrders)) {
            throw new GridException('Wrong column order');
        }
        if (strtolower($order) != Grid::ORDER_ASC && strtolower($order) != Grid::ORDER_DESC) {
            throw new GridException('Order for column "' . $column . '" is incorrect');
        }
        $column = $this->applyAlias($column);
        $this->orders[$column] = $order;
    }