public function MoveCatAction() { $request = Project::getRequest(); $frCat = $request->getKeyByNumber(0); $toCat = $request->getKeyByNumber(1); if ($frCat !== null && $toCat !== null) { $frCatModel = new QuestionCatModel(); $toCatModel = new QuestionCatModel(); $res = $frCatModel->load((int) $frCat); $frCatModel->bind($res); $res = $toCatModel->load((int) $toCat); $toCatModel->bind($res); $tmp = $frCatModel->sortfield; $frCatModel->sortfield = $toCatModel->sortfield; $toCatModel->sortfield = $tmp; $frCatModel->save(); $toCatModel->save(); } Project::getResponse()->Redirect($request->createUrl('AdminQuestionAnswer', 'CatList')); }