Ojs\AdminBundle\Controller\AdminIndexController::updateAction PHP Method

updateAction() public method

Edits an existing Index entity.
public updateAction ( Request $request, Ojs\JournalBundle\Entity\Index $entity ) : RedirectResponse | Response
$request Symfony\Component\HttpFoundation\Request
$entity Ojs\JournalBundle\Entity\Index
return Symfony\Component\HttpFoundation\RedirectResponse | Symfony\Component\HttpFoundation\Response
    public function updateAction(Request $request, Index $entity)
    {
        $this->throw404IfNotFound($entity);
        $em = $this->getDoctrine()->getManager();
        $editForm = $this->createEditForm($entity)->add('save', 'submit');
        $editForm->handleRequest($request);
        if ($editForm->isValid()) {
            $em->persist($entity);
            $em->flush();
            $this->successFlashBag('successful.update');
            return $this->redirect($this->generateUrl('ojs_admin_index_edit', array('id' => $entity->getId())));
        }
        return $this->render('OjsAdminBundle:AdminIndex:edit.html.twig', array('entity' => $entity, 'edit_form' => $editForm->createView()));
    }