/** * Уменьшение индекса сортировка для вопроса (перемещение вверх в списке) * @return void */ public function upAction() { if ($this->_authorize('question', 'up')) { $arrParams = $this->getRequest()->getParams(); if (array_key_exists('questionId', $arrParams) && !empty($arrParams['questionId'])) { $questionId = (int) $arrParams['questionId']; } else { throw new Exception('[LS_REQUIRED_PARAM_FAILED]'); } if (array_key_exists('testId', $arrParams) && !empty($arrParams['testId'])) { $testId = (int) $arrParams['testId']; } else { throw new Exception('[LS_REQUIRED_PARAM_FAILED]'); } $objQuestions = new Questions(); $objQuestions->moveQuestionUp($questionId, $testId); if (array_key_exists('testId', $arrParams) && !empty($arrParams['testId'])) { $this->_helper->redirector('edit', 'test', null, array('testId' => $testId)); } } }