public function applySorting($i, $field, $desc)
    {
        if (!$field) {
            return;
        }
        if ($i instanceof DB_dsql) {
            $i->order($field, $desc);
        } elseif ($i instanceof \atk4\data\Model) {
            $i->setOrder($field, $desc);
        } elseif ($i instanceof SQL_Model) {
            $i->setOrder($field, $desc);
        } elseif ($i instanceof Model) {
            $i->setOrder($field, $desc);
        }
    }