Ojs\AdminBundle\Controller\AdminPersonTitleController::createAction PHP Method

createAction() public method

Creates a new PersonTitle entity.
public createAction ( Request $request ) : RedirectResponse | Response
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\RedirectResponse | Symfony\Component\HttpFoundation\Response
    public function createAction(Request $request)
    {
        $entity = new PersonTitle();
        $form = $this->createCreateForm($entity);
        $form->handleRequest($request);
        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($entity);
            $em->flush();
            return $this->redirect($this->generateUrl('ojs_admin_person_title_show', array('id' => $entity->getId())));
        }
        return $this->render('OjsAdminBundle:AdminPersonTitle:new.html.twig', array('entity' => $entity, 'form' => $form->createView()));
    }