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(),
        );
    }