/**
  * toggleArticleAction
  * Change the "published" attribute of the article
  * @param \Gore\BlogBundle\Entity\Article $article
  * @return type
  */
 public function toggleArticleAction(Article $article)
 {
     if ($article) {
         $em = $this->getDoctrine()->getManager();
         $newpub = $article->getPublished() == true ? false : true;
         $article->setPublished($newpub);
         $em->persist($article);
         $em->flush();
         $status = $newpub == true ? "ONLINE" : "OFFLINE";
         $message = 'The article "' . $article->getTitle() . '" has been successfully put ' . $status . '.';
         $this->get('session')->getFlashBag()->add('notice', $message);
         return $this->redirect($this->generateUrl('gore_blog_admin_manage_articles'));
     } else {
         // If article couldn't be loaded
         $this->get('session')->getFlashBag()->add('error', 'Sorry, impossible to toggle the article.');
     }
     return $this->redirect($this->generateUrl('gore_blog_admin_manage_articles'));
 }