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;
    }