Beispiel #1
0
 /**
  * @Route("/link/add-ajax", name="link-add-ajax")
  * @param Request $request
  * @return string|Response
  */
 public function addNewAjaxAction(Request $request)
 {
     $link = new Link();
     $link->setHeading($request->get('title'));
     $link->setLink($request->get('link'));
     $link->setDescription($request->get('desc'));
     $link->setUserId($this->getUser());
     $catId = (int) $request->get('category');
     $link->setTags($request->get('tags'));
     if ($request->request->get('article')['privacy'] == 'internal') {
         $link->setPrivate(true);
     } else {
         $link->setPrivate(false);
     }
     $this->get('link_manager')->saveLink($link, $catId);
     return new Response('Created link ' . $link->getHeading());
 }
 /**
  * {@inheritDoc}
  */
 public function setDescription($description)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDescription', array($description));
     return parent::setDescription($description);
 }