public function addManuallyAction(Request $request)
    {
        $response = $this->getCacheTimeKeeper()->getResponse();
        // response was not modified for this request
        if ($response->isNotModified($request)) {
            return $response;
        }

        $item = new Item();

        /* @var $form Form */
        $form = $this->createForm('entity_item', $item)
            ->handleRequest($request);
        if ($form->isValid()) {
            /* @var $rep ItemRepository */
            $rep = $this->getDoctrine()->getRepository('AnimeDbCatalogBundle:Item');

            // Add a new entry only if no duplicates
            $duplicate = $rep->findDuplicate($item);
            if ($duplicate) {
                $request->getSession()->set(self::NAME_ITEM_ADDED, $item);

                return $this->redirect($this->generateUrl('item_duplicate'));
            } else {
                return $this->addItem($item);
            }
        }

        return $this->render('AnimeDbCatalogBundle:Item:add-manually.html.twig', [
            'form' => $form->createView(),
        ], $response);
    }
public function addManuallyAction(Request $request)
    {
        $response = $this->getCacheTimeKeeper()->getResponse();
        // response was not modified for this request
        if ($response->isNotModified($request)) {
            return $response;
        }

        $item = new Item();

        /* @var $form Form */
        $form = $this->createForm('entity_item', $item)
            ->handleRequest($request);
        if ($form->isValid()) {
            /* @var $rep ItemRepository */
            $rep = $this->getDoctrine()->getRepository('AnimeDbCatalogBundle:Item');

            // Add a new entry only if no duplicates
            $duplicate = $rep->findDuplicate($item);
            if ($duplicate) {
                $request->getSession()->set(self::NAME_ITEM_ADDED, $item);

                return $this->redirect($this->generateUrl('item_duplicate'));
            } else {
                return $this->addItem($item);
            }
        }

        return $this->render('AnimeDbCatalogBundle:Item:add-manually.html.twig', [
            'form' => $form->createView(),
        ], $response);
    }
public function addManuallyAction ( Request $ request ) { $ response = $ this -> getCacheTimeKeeper ( ) -> getResponse ( ) ; // response was not modified for this request if ( $ response -> isNotModified ( $ request ) ) { return $ response ; } $ item = new Item ( ) ; /* @var $form Form */ $ form = $ this -> createForm ( 'entity_item' , $ item ) -> handleRequest ( $ request ) ; if ( $ form -> isValid ( ) ) { /* @var $rep ItemRepository */ $ rep = $ this -> getDoctrine ( ) -> getRepository ( 'AnimeDbCatalogBundle:Item' ) ; // Add a new entry only if no duplicates $ duplicate = $ rep -> findDuplicate ( $ item ) ; if ( $ duplicate ) { $ request -> getSession ( ) -> set ( self :: NAME_ITEM_ADDED , $ item ) ; return $ this -> redirect ( $ this -> generateUrl ( 'item_duplicate' ) ) ; } else { return $ this -> addItem ( $ item ) ; } } return $ this -> render ( 'AnimeDbCatalogBundle:Item:add-manually.html.twig' , [ 'form' => $ form -> createView ( ) , ] , $ response ) ; }
Addition form.

@param Request $request

@return Response
Addition form .