Bundle/SeoBundle/Controller/Error404Controller.php
private function returnAfterRemoval(Error404 $error404)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var HttpErrorRepository $errorRepository */
        $errorRepository = $em->getRepository('VictoireSeoBundle:HttpError');

        $errors = ($error404->getType() == HttpError::TYPE_ROUTE)
            ? $errorRepository->getRouteErrors()
            : $errorRepository->getFileErrors();

        if (0 == count($errors->getQuery()->getResult())) {
            return new Response($this->renderView('@VictoireSeo/Error404/_empty.html.twig'), 200, [
                'X-Inject-Alertify' => true,
            ]);
        }

        return new Response(null, 200, [
            'X-VIC-Remove'      => '100ms',
            'X-Inject-Alertify' => true,
        ]);
    }
private function returnAfterRemoval(Error404 $error404)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var HttpErrorRepository $errorRepository */
        $errorRepository = $em->getRepository('VictoireSeoBundle:HttpError');

        $errors = ($error404->getType() == HttpError::TYPE_ROUTE)
            ? $errorRepository->getRouteErrors()
            : $errorRepository->getFileErrors();

        if (0 == count($errors->getQuery()->getResult())) {
            return new Response($this->renderView('@VictoireSeo/Error404/_empty.html.twig'), 200, [
                'X-Inject-Alertify' => true,
            ]);
        }

        return new Response(null, 200, [
            'X-VIC-Remove'      => '100ms',
            'X-Inject-Alertify' => true,
        ]);
    }
private function returnAfterRemoval ( Error404 $ error404 ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; /** @var HttpErrorRepository $errorRepository */ $ errorRepository = $ em -> getRepository ( 'VictoireSeoBundle:HttpError' ) ; $ errors = ( $ error404 -> getType ( ) == HttpError :: TYPE_ROUTE ) ? $ errorRepository -> getRouteErrors ( ) : $ errorRepository -> getFileErrors ( ) ; if ( 0 == count ( $ errors -> getQuery ( ) -> getResult ( ) ) ) { return new Response ( $ this -> renderView ( '@VictoireSeo/Error404/_empty.html.twig' ) , 200 , [ 'X-Inject-Alertify' => true , ] ) ; } return new Response ( null , 200 , [ 'X-VIC-Remove' => '100ms' , 'X-Inject-Alertify' => true , ] ) ; }
Remove error if there is more than one record, else return _empty template.

@param Error404 $error404

@return Response
Remove error if there is more than one record else return _empty template .