Beispiel #1
0
 /**
  * @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;
     });
 }
Beispiel #2
0
 /**
  * @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;
     });
 }
Beispiel #3
0
 /**
  * @param string $action
  *
  * @return mixed
  * @throws \ACP3\Core\Controller\Exception\ResultNotExistsException
  */
 public function execute($action = '')
 {
     return $this->actionHelper->handleDeleteAction($action, function (array $items) {
         return $this->articlesModel->delete($items);
     });
 }