Controller/BoardController.php
public function archiveAction(
        string $production_slug,
        AuthorizationCheckerInterface $auth,
        PaginatorInterface $paginator,
        Request $request
    ): Response {
        // Lookup the production by production_slug.
        $production_repo = $this->em->getRepository(Production::class);
        if (null === $production = $production_repo->findOneBy(['slug' => $production_slug])) {
            throw new NotFoundHttpException();
        }

        // Check permissions for this action.
        if (!$auth->isGranted('GROUP_ROLE_EDITOR', $production)) {
            throw new AccessDeniedException();
        }

        // Get notice board posts.
        $query = $this->em->getRepository(Post::class)->getAllInactiveQuery($production);

        // Return response.
        $posts = $paginator->paginate($query, $request->query->getInt('page', 1));

        return new Response($this->templating->render('@BkstgNoticeBoard/Board/archive.html.twig', [
            'production' => $production,
            'posts' => $posts,
        ]));
    }
public function archiveAction(
        string $production_slug,
        AuthorizationCheckerInterface $auth,
        PaginatorInterface $paginator,
        Request $request
    ): Response {
        // Lookup the production by production_slug.
        $production_repo = $this->em->getRepository(Production::class);
        if (null === $production = $production_repo->findOneBy(['slug' => $production_slug])) {
            throw new NotFoundHttpException();
        }

        // Check permissions for this action.
        if (!$auth->isGranted('GROUP_ROLE_EDITOR', $production)) {
            throw new AccessDeniedException();
        }

        // Get notice board posts.
        $query = $this->em->getRepository(Post::class)->getAllInactiveQuery($production);

        // Return response.
        $posts = $paginator->paginate($query, $request->query->getInt('page', 1));

        return new Response($this->templating->render('@BkstgNoticeBoard/Board/archive.html.twig', [
            'production' => $production,
            'posts' => $posts,
        ]));
    }
public function archiveAction ( string $ production_slug , AuthorizationCheckerInterface $ auth , PaginatorInterface $ paginator , Request $ request ) : Response { // Lookup the production by production_slug. $ production_repo = $ this -> em -> getRepository ( Production :: class ) ; if ( null === $ production = $ production_repo -> findOneBy ( [ 'slug' => $ production_slug ] ) ) { throw new NotFoundHttpException ( ) ; } // Check permissions for this action. if ( ! $ auth -> isGranted ( 'GROUP_ROLE_EDITOR' , $ production ) ) { throw new AccessDeniedException ( ) ; } // Get notice board posts. $ query = $ this -> em -> getRepository ( Post :: class ) -> getAllInactiveQuery ( $ production ) ; // Return response. $ posts = $ paginator -> paginate ( $ query , $ request -> query -> getInt ( 'page' , 1 ) ) ; return new Response ( $ this -> templating -> render ( '@BkstgNoticeBoard/Board/archive.html.twig' , [ 'production' => $ production , 'posts' => $ posts , ] ) ) ; }
Show archive for the notice board.

@param string                        $production_slug The production slug.
@param AuthorizationCheckerInterface $auth            The authorization checker service.
@param PaginatorInterface            $paginator       The paginator service.
@param Request                       $request         The incoming request.

@throws NotFoundHttpException When the production is not found.
@throws AccessDeniedException When the user is not an editor of the production.

@return Response
Show archive for the notice board .