public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
/** @var PublisherTypes $entity */
$entity = $em->getRepository('OjsJournalBundle:PublisherTypes')->find($id);
$this->throw404IfNotFound($entity);
$editForm = $this->createEditForm($entity);
$editForm->handleRequest($request);
if ($editForm->isValid()) {
$entity->setSlug($entity->getTranslationByLocale($request->getDefaultLocale())->getName());
$em->flush();
$this->successFlashBag('successful.update');
return $this->redirectToRoute('ojs_admin_publisher_type_edit', ['id' => $id]);
}
return $this->render('OjsAdminBundle:AdminPublisherType:edit.html.twig', array('entity' => $entity, 'edit_form' => $editForm->createView()));
}