protected function processOrder($order, $context)
    {
        if ($order instanceof Order || $order instanceof OrderByIsNull) {
            $column = $this->processColumnOrSubQuery($order->column, $context);

            if ($column === $order->column) {
                return $order;
            } elseif ($order instanceof Order) {
                return new Order($column, $order->isDescending);
            } else {
                return new OrderByIsNull($column, $order->areNullFirst);
            }
        }

        if ($order instanceof ExplicitOrder) {
            $column = $this->processColumnOrSubQuery($order->column, $context);

            $values = [];
            foreach ($order->order as $index => $value) {
                $values[$index] = $this->processValueOrSubQuery($value, $context);
            }

            if ($column === $order->column && $values === $order->order) {
                return $order;
            } else {
                return new ExplicitOrder($column, $values, $order->areOtherFirst);
            }
        }

        return $order;
    }
protected function processOrder($order, $context)
    {
        if ($order instanceof Order || $order instanceof OrderByIsNull) {
            $column = $this->processColumnOrSubQuery($order->column, $context);

            if ($column === $order->column) {
                return $order;
            } elseif ($order instanceof Order) {
                return new Order($column, $order->isDescending);
            } else {
                return new OrderByIsNull($column, $order->areNullFirst);
            }
        }

        if ($order instanceof ExplicitOrder) {
            $column = $this->processColumnOrSubQuery($order->column, $context);

            $values = [];
            foreach ($order->order as $index => $value) {
                $values[$index] = $this->processValueOrSubQuery($value, $context);
            }

            if ($column === $order->column && $values === $order->order) {
                return $order;
            } else {
                return new ExplicitOrder($column, $values, $order->areOtherFirst);
            }
        }

        return $order;
    }
protected function processOrder ( $ order , $ context ) { if ( $ order instanceof Order || $ order instanceof OrderByIsNull ) { $ column = $ this -> processColumnOrSubQuery ( $ order -> column , $ context ) ; if ( $ column === $ order -> column ) { return $ order ; } elseif ( $ order instanceof Order ) { return new Order ( $ column , $ order -> isDescending ) ; } else { return new OrderByIsNull ( $ column , $ order -> areNullFirst ) ; } } if ( $ order instanceof ExplicitOrder ) { $ column = $ this -> processColumnOrSubQuery ( $ order -> column , $ context ) ; $ values = [ ] ; foreach ( $ order -> order as $ index => $ value ) { $ values [ $ index ] = $ this -> processValueOrSubQuery ( $ value , $ context ) ; } if ( $ column === $ order -> column && $ values === $ order -> order ) { return $ order ; } else { return new ExplicitOrder ( $ column , $ values , $ order -> areOtherFirst ) ; } } return $ order ; }
Processes a single order statement.

@param Order|OrderByIsNull|ExplicitOrder|string $order
@param mixed $context The processing context
@return Order|string
Processes a single order statement .