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

        $rep = $this->getRepository();
        $change_form = $this->createForm(new ChangeNotice())->handleRequest($request);
        if ($change_form->isValid() && ($notices = $change_form->getData()['notices'])) {
            switch ($change_form->getData()['action']) {
                case ChangeNotice::ACTION_SET_STATUS_SHOWN:
                    $rep->setStatus($notices->toArray(), Notice::STATUS_SHOWN);
                    break;
                case ChangeNotice::ACTION_SET_STATUS_CLOSED:
                    $rep->setStatus($notices->toArray(), Notice::STATUS_CLOSED);
                    break;
                case ChangeNotice::ACTION_REMOVE:
                    $rep->remove($notices->toArray());
            }

            return $this->redirect($this->generateUrl('notice_list'));
        }

        return $this->render('AnimeDbCatalogBundle:Notice:index.html.twig', [
            'has_notices' => $rep->count(),
        ], $response);
    }
public function indexAction(Request $request)
    {
        $response = $this->getCacheTimeKeeper()->getResponse('AnimeDbAppBundle:Notice');
        // response was not modified for this request
        if ($response->isNotModified($request)) {
            return $response;
        }

        $rep = $this->getRepository();
        $change_form = $this->createForm(new ChangeNotice())->handleRequest($request);
        if ($change_form->isValid() && ($notices = $change_form->getData()['notices'])) {
            switch ($change_form->getData()['action']) {
                case ChangeNotice::ACTION_SET_STATUS_SHOWN:
                    $rep->setStatus($notices->toArray(), Notice::STATUS_SHOWN);
                    break;
                case ChangeNotice::ACTION_SET_STATUS_CLOSED:
                    $rep->setStatus($notices->toArray(), Notice::STATUS_CLOSED);
                    break;
                case ChangeNotice::ACTION_REMOVE:
                    $rep->remove($notices->toArray());
            }

            return $this->redirect($this->generateUrl('notice_list'));
        }

        return $this->render('AnimeDbCatalogBundle:Notice:index.html.twig', [
            'has_notices' => $rep->count(),
        ], $response);
    }
public function indexAction ( Request $ request ) { $ response = $ this -> getCacheTimeKeeper ( ) -> getResponse ( 'AnimeDbAppBundle:Notice' ) ; // response was not modified for this request if ( $ response -> isNotModified ( $ request ) ) { return $ response ; } $ rep = $ this -> getRepository ( ) ; $ change_form = $ this -> createForm ( new ChangeNotice ( ) ) -> handleRequest ( $ request ) ; if ( $ change_form -> isValid ( ) && ( $ notices = $ change_form -> getData ( ) [ 'notices' ] ) ) { switch ( $ change_form -> getData ( ) [ 'action' ] ) { case ChangeNotice :: ACTION_SET_STATUS_SHOWN : $ rep -> setStatus ( $ notices -> toArray ( ) , Notice :: STATUS_SHOWN ) ; break ; case ChangeNotice :: ACTION_SET_STATUS_CLOSED : $ rep -> setStatus ( $ notices -> toArray ( ) , Notice :: STATUS_CLOSED ) ; break ; case ChangeNotice :: ACTION_REMOVE : $ rep -> remove ( $ notices -> toArray ( ) ) ; } return $ this -> redirect ( $ this -> generateUrl ( 'notice_list' ) ) ; } return $ this -> render ( 'AnimeDbCatalogBundle:Notice:index.html.twig' , [ 'has_notices' => $ rep -> count ( ) , ] , $ response ) ; }
Edit list notices.

@param Request $request

@return Response
Edit list notices .