예제 #1
0
 public function create($title, Level $level)
 {
     $obj = new Question();
     $obj->setTitle($title)->setLevel($level);
     $this->_em->persist($obj);
     $this->_em->flush($obj);
     return $obj;
 }
예제 #2
0
 /**
  * Creates a form to delete a Question entity.
  *
  * @param Question $question The Question entity
  *
  * @return \Symfony\Component\Form\Form The form
  */
 private function createDeleteForm(Question $question)
 {
     return $this->createFormBuilder()->setAction($this->generateUrl('question_delete', ['id' => $question->getId()]))->setMethod('DELETE')->getForm();
 }