public function create($title, Level $level) { $obj = new Question(); $obj->setTitle($title)->setLevel($level); $this->_em->persist($obj); $this->_em->flush($obj); return $obj; }