/** * @param array $formData * @param int $articleId * * @return \Symfony\Component\HttpFoundation\RedirectResponse */ protected function executePost(array $formData, $articleId) { return $this->actionHelper->handleEditPostAction(function () use($formData, $articleId) { $this->adminFormValidation->setUriAlias(sprintf(Articles\Helpers::URL_KEY_PATTERN, $articleId))->validate($formData); $formData['user_id'] = $this->user->getUserId(); $result = $this->articlesModel->save($formData, $articleId); $this->createOrUpdateMenuItem($formData, $articleId); return $result; }); }
/** * @param array $formData * * @return \Symfony\Component\HttpFoundation\RedirectResponse */ protected function executePost(array $formData) { return $this->actionHelper->handleCreatePostAction(function () use($formData) { $this->adminFormValidation->validate($formData); $formData['user_id'] = $this->user->getUserId(); $articleId = $this->articlesModel->save($formData); $this->createOrUpdateMenuItem($formData, $articleId); return $articleId; }); }