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

updateAction() public method

Edits an existing PublisherManagers entity.
public updateAction ( Request $request, PublisherManagers $entity ) : RedirectResponse | Response
$request Symfony\Component\HttpFoundation\Request
$entity Ojs\AdminBundle\Entity\PublisherManagers
return Symfony\Component\HttpFoundation\RedirectResponse | Symfony\Component\HttpFoundation\Response
    public function updateAction(Request $request, PublisherManagers $entity)
    {
        $em = $this->getDoctrine()->getManager();
        $this->throw404IfNotFound($entity);
        /** @var $dispatcher EventDispatcherInterface */
        $dispatcher = $this->get('event_dispatcher');
        $editForm = $this->createEditForm($entity);
        $editForm->handleRequest($request);
        if ($editForm->isValid()) {
            $em->flush();
            $this->successFlashBag('successful.update');
            $event = new AdminEvent(['eventType' => 'update', 'entity' => $entity]);
            $dispatcher->dispatch(AdminEvents::PUBLISHER_MANAGER_CHANGE, $event);
            return $this->redirectToRoute('ojs_admin_publisher_managers_edit', ['id' => $entity->getId()]);
        }
        return $this->render('OjsAdminBundle:AdminPublisherManagers:edit.html.twig', array('entity' => $entity, 'edit_form' => $editForm->createView()));
    }