public function deleteAction() { if ($this->request->isGet() && $this->request->isXmlHttpRequest()) { $pieces = explode("-", $this->request->getQuery()->id); $article = $this->articleService->getArticleById($pieces[1]); if ($article) { $this->articleService->deleteArticle($article); return new JsonModel(array($pieces[1])); } else { return new JsonModel(array()); } } return $this->response; }