public function createAction(Request $request)
{
/** @var $dispatcher EventDispatcherInterface */
$dispatcher = $this->get('event_dispatcher');
$entity = new Publisher();
$entity->setCurrentLocale($request->getDefaultLocale());
$form = $this->createCreateForm($entity);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->flush();
$this->successFlashBag('successful.create');
$event = new AdminEvent(['eventType' => 'create', 'entity' => $entity]);
$dispatcher->dispatch(AdminEvents::PUBLISHER_CHANGE, $event);
return $this->redirectToRoute('ojs_admin_publisher_show', ['id' => $entity->getId()]);
}
return $this->render('OjsAdminBundle:AdminPublisher:new.html.twig', array('entity' => $entity, 'form' => $form->createView()));
}