public function changeAction(Item $item, Request $request)
    {
        /* @var $form Form */
        $form = $this->createForm('entity_item', $item)
            ->handleRequest($request);
        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($item);
            $em->flush();

            return $this->redirect($this->generateUrl(
                'item_show',
                ['id' => $item->getId(), 'name' => $item->getUrlName()]
            ));
        }

        return $this->render('AnimeDbCatalogBundle:Item:change.html.twig', [
            'item' => $item,
            'form' => $form->createView(),
        ]);
    }
public function changeAction(Item $item, Request $request)
    {
        /* @var $form Form */
        $form = $this->createForm('entity_item', $item)
            ->handleRequest($request);
        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($item);
            $em->flush();

            return $this->redirect($this->generateUrl(
                'item_show',
                ['id' => $item->getId(), 'name' => $item->getUrlName()]
            ));
        }

        return $this->render('AnimeDbCatalogBundle:Item:change.html.twig', [
            'item' => $item,
            'form' => $form->createView(),
        ]);
    }
public function changeAction ( Item $ item , Request $ request ) { /* @var $form Form */ $ form = $ this -> createForm ( 'entity_item' , $ item ) -> handleRequest ( $ request ) ; if ( $ form -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> persist ( $ item ) ; $ em -> flush ( ) ; return $ this -> redirect ( $ this -> generateUrl ( 'item_show' , [ 'id' => $ item -> getId ( ) , 'name' => $ item -> getUrlName ( ) ] ) ) ; } return $ this -> render ( 'AnimeDbCatalogBundle:Item:change.html.twig' , [ 'item' => $ item , 'form' => $ form -> createView ( ) , ] ) ; }
Change item.

@param Item $item
@param Request $request

@return Response
Change item .