original_string: public function createAction(Request $request)
      {
          $stocktransfer = new StockTransfer();
          $stocktransfer->setUser($this->getUser());
          $form = $this->createForm(new StockTransferType(), $stocktransfer);
          if ($form->handleRequest($request)->isValid()) {
              $em = $this->getDoctrine()->getManager();
              $em->persist($stocktransfer);
              $em->flush();
  
              return $this->redirect($this->generateUrl('stock_transfers_show', array('id' => $stocktransfer->getId())));
          }
  
          return array(
              'stocktransfer' => $stocktransfer,
              'form' => $form->createView(),
          );
      }
code: public function createAction(Request $request)
      {
          $stocktransfer = new StockTransfer();
          $stocktransfer->setUser($this->getUser());
          $form = $this->createForm(new StockTransferType(), $stocktransfer);
          if ($form->handleRequest($request)->isValid()) {
              $em = $this->getDoctrine()->getManager();
              $em->persist($stocktransfer);
              $em->flush();
  
              return $this->redirect($this->generateUrl('stock_transfers_show', array('id' => $stocktransfer->getId())));
          }
  
          return array(
              'stocktransfer' => $stocktransfer,
              'form' => $form->createView(),
          );
      }
code_tokens: public function createAction ( Request $ request ) { $ stocktransfer = new StockTransfer ( ) ; $ stocktransfer -> setUser ( $ this -> getUser ( ) ) ; $ form = $ this -> createForm ( new StockTransferType ( ) , $ stocktransfer ) ; if ( $ form -> handleRequest ( $ request ) -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> persist ( $ stocktransfer ) ; $ em -> flush ( ) ; return $ this -> redirect ( $ this -> generateUrl ( 'stock_transfers_show' , array ( 'id' => $ stocktransfer -> getId ( ) ) ) ) ; } return array ( 'stocktransfer' => $ stocktransfer , 'form' => $ form -> createView ( ) , ) ; }
docstring: Creates a new StockTransfer entity.
  
  @Route("/create", name="stock_transfers_create")
  @Method("POST")
  @Template("FlowerStockBundle:StockTransfer:new.html.twig")
docstring_tokens: Creates a new StockTransfer entity .