Esempio n. 1
0
 public function createTopicAction(Request $request)
 {
     $db = $this->getDoctrine()->getManager();
     $topic = new Topic();
     $topic->setName($request->get('name'));
     $db->getRepository('BlogBundle:Topic')->save($topic);
     return $this->redirect($this->generateUrl('topic'));
 }
Esempio n. 2
0
 public function insert($request)
 {
     $topic = new Topic();
     $topic->setTitle($request->get('topic')['title']);
     $this->save($topic);
 }