Ojs\AdminBundle\Controller\AdminSystemSettingsController::indexAction PHP Method

indexAction() public method

public indexAction ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
return Symfony\Component\HttpFoundation\Response
    public function indexAction(Request $request)
    {
        $em = $this->getDoctrine()->getManager();
        $systemSetting = $em->getRepository('OjsAdminBundle:SystemSetting')->findOneBy([]);
        if (!$systemSetting) {
            $systemSetting = $this->createSystemSetting();
        }
        $form = $this->createForm(new SystemSettingsType(), $systemSetting);
        $form->handleRequest($request);
        if ($form->isValid() && $request->getMethod() == 'POST') {
            $em->persist($systemSetting);
            $em->flush();
            $this->successFlashBag('successful.update');
        }
        return $this->render('OjsAdminBundle:AdminSystemSetting:index.html.twig', array('entity' => $systemSetting, 'form' => $form->createView()));
    }
AdminSystemSettingsController