public function createAction(Request $request)
{
$entity = new Journal();
$entity->setCurrentLocale($request->getDefaultLocale());
/** @var $dispatcher EventDispatcherInterface */
$dispatcher = $this->get('event_dispatcher');
$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::ADMIN_JOURNAL_CHANGE, $event);
return $this->redirect($this->generateUrl('ojs_admin_journal_show', array('id' => $entity->getId())));
}
return $this->render('OjsAdminBundle:AdminJournal:new.html.twig', array('entity' => $entity, 'form' => $form->createView()));
}