original_string: public function newAction(Request $request)
      {
          $paymentServiceProvider = new PaymentServiceProvider();
          $form = $this->createForm('EcommerceBundle\Form\PaymentServiceProviderType', $paymentServiceProvider);
          $form->handleRequest($request);
  
          if ($form->isSubmitted() && $form->isValid()) {
               
              $em = $this->getDoctrine()->getManager();
              $em->persist($paymentServiceProvider);
              $em->persist($paymentServiceProvider->getPaymentMethod());
              $em->flush();
  
              return $this->redirectToRoute('ecommerce_paymentserviceprovider_show', array('id' => $paymentServiceProvider->getId()));
          }
  
          return array(
              'paymentServiceProvider' => $paymentServiceProvider,
              'form' => $form->createView(),
          );
      }
code: public function newAction(Request $request)
      {
          $paymentServiceProvider = new PaymentServiceProvider();
          $form = $this->createForm('EcommerceBundle\Form\PaymentServiceProviderType', $paymentServiceProvider);
          $form->handleRequest($request);
  
          if ($form->isSubmitted() && $form->isValid()) {
               
              $em = $this->getDoctrine()->getManager();
              $em->persist($paymentServiceProvider);
              $em->persist($paymentServiceProvider->getPaymentMethod());
              $em->flush();
  
              return $this->redirectToRoute('ecommerce_paymentserviceprovider_show', array('id' => $paymentServiceProvider->getId()));
          }
  
          return array(
              'paymentServiceProvider' => $paymentServiceProvider,
              'form' => $form->createView(),
          );
      }
code_tokens: public function newAction ( Request $ request ) { $ paymentServiceProvider = new PaymentServiceProvider ( ) ; $ form = $ this -> createForm ( 'EcommerceBundle\Form\PaymentServiceProviderType' , $ paymentServiceProvider ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isSubmitted ( ) && $ form -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> persist ( $ paymentServiceProvider ) ; $ em -> persist ( $ paymentServiceProvider -> getPaymentMethod ( ) ) ; $ em -> flush ( ) ; return $ this -> redirectToRoute ( 'ecommerce_paymentserviceprovider_show' , array ( 'id' => $ paymentServiceProvider -> getId ( ) ) ) ; } return array ( 'paymentServiceProvider' => $ paymentServiceProvider , 'form' => $ form -> createView ( ) , ) ; }
docstring: Creates a new PaymentServiceProvider entity.
  
  @Route("/new")
  @Method({"GET", "POST"})
  @Template()
docstring_tokens: Creates a new PaymentServiceProvider entity .