Code Duplication    Length = 10-11 lines in 2 locations

Controller/GroupController.php 1 location

@@ 85-95 (lines=11) @@
82
			->getForm();
83
		############################################################################################################
84
		
85
		if($request->isMethod('POST')) {
86
			$form->bind($request);
87
			if($form->isValid()) {
88
				$em = $this->getDoctrine()->getManager();
89
				
90
				$em->persist($obj);
91
				$em->flush();
92
				$this->get('session')->getFlashBag()->add('success', sprintf('The %s has been %s successfully', $name, $key ? 'modified' : 'created'));
93
				return $this->render('VivaitBootstrapBundle:Default:redirect.html.twig', array('redirect' => $request->query->get('parent', $request->request->get('parent', $request->headers->get('referer')))));
94
			}
95
		}
96
		if(isset($form)) {
97
			$formtpl['form'] = $form->createView();
98
		}

Controller/TenantController.php 1 location

@@ 86-95 (lines=10) @@
83
				->getForm();
84
			############################################################################################################
85
86
			if($request->isMethod('POST')) {
87
				$form->bind($request);
88
				if($form->isValid()) {
89
					$em = $this->getDoctrine()->getManager();
90
					$em->persist($obj);
91
					$em->flush();
92
					$this->get('session')->getFlashBag()->add('success', sprintf('The %s has been %s successfully', $name, $key ? 'modified' : 'created'));
93
					return $this->render('VivaitBootstrapBundle:Default:redirect.html.twig', array('redirect' => $request->query->get('parent', $request->request->get('parent', $request->headers->get('referer')))));
94
				}
95
			}
96
			if(isset($form)) {
97
				$formtpl['form'] = $form->createView();
98
			}