public function archiveAction(
        string $production_slug,
        PaginatorInterface $paginator,
        AuthorizationCheckerInterface $auth,
        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 a list of archived events.
        $event_repo = $this->em->getRepository(Event::class);
        $query = $event_repo->findArchivedEventsQuery($production);

        // Paginate and render the results.
        $events = $paginator->paginate($query, $request->query->getInt('page', 1));

        return new Response($this->templating->render('@BkstgSchedule/Event/archive.html.twig', [
            'events' => $events,
            'production' => $production,
        ]));
    }
public function archiveAction(
        string $production_slug,
        PaginatorInterface $paginator,
        AuthorizationCheckerInterface $auth,
        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 a list of archived events.
        $event_repo = $this->em->getRepository(Event::class);
        $query = $event_repo->findArchivedEventsQuery($production);

        // Paginate and render the results.
        $events = $paginator->paginate($query, $request->query->getInt('page', 1));

        return new Response($this->templating->render('@BkstgSchedule/Event/archive.html.twig', [
            'events' => $events,
            'production' => $production,
        ]));
    }
public function archiveAction ( string $ production_slug , PaginatorInterface $ paginator , AuthorizationCheckerInterface $ auth , 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 a list of archived events. $ event_repo = $ this -> em -> getRepository ( Event :: class ) ; $ query = $ event_repo -> findArchivedEventsQuery ( $ production ) ; // Paginate and render the results. $ events = $ paginator -> paginate ( $ query , $ request -> query -> getInt ( 'page' , 1 ) ) ; return new Response ( $ this -> templating -> render ( '@BkstgSchedule/Event/archive.html.twig' , [ 'events' => $ events , 'production' => $ production , ] ) ) ; }
Show a list of archived events.

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

@throws NotFoundHttpException When the production does not exist.
@throws AccessDeniedException When the user is not an editor.

@return Response
Show a list of archived events .