public function readAction(
        int $id,
        string $production_slug,
        AuthorizationCheckerInterface $auth,
        PaginatorInterface $paginator,
        Request $request
    ): Response {
        // Get the schedule and production for this action.
        list($schedule, $production) = $this->lookupEntity(Schedule::class, $id, $production_slug);

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

        // Get and sort the events.
        $events = $schedule->getEvents()->toArray();
        usort($events, function ($a, $b) {
            return $a->getStart() > $b->getStart();
        });

        // Render the schedule.
        return new Response($this->templating->render('@BkstgSchedule/Schedule/read.html.twig', [
            'production' => $production,
            'schedule' => $schedule,
            'sorted_events' => $events,
        ]));
    }
public function readAction(
        int $id,
        string $production_slug,
        AuthorizationCheckerInterface $auth,
        PaginatorInterface $paginator,
        Request $request
    ): Response {
        // Get the schedule and production for this action.
        list($schedule, $production) = $this->lookupEntity(Schedule::class, $id, $production_slug);

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

        // Get and sort the events.
        $events = $schedule->getEvents()->toArray();
        usort($events, function ($a, $b) {
            return $a->getStart() > $b->getStart();
        });

        // Render the schedule.
        return new Response($this->templating->render('@BkstgSchedule/Schedule/read.html.twig', [
            'production' => $production,
            'schedule' => $schedule,
            'sorted_events' => $events,
        ]));
    }
public function readAction ( int $ id , string $ production_slug , AuthorizationCheckerInterface $ auth , PaginatorInterface $ paginator , Request $ request ) : Response { // Get the schedule and production for this action. list ( $ schedule , $ production ) = $ this -> lookupEntity ( Schedule :: class , $ id , $ production_slug ) ; // Check permissions for this action. if ( ! $ auth -> isGranted ( 'view' , $ schedule ) ) { throw new AccessDeniedException ( ) ; } // Get and sort the events. $ events = $ schedule -> getEvents ( ) -> toArray ( ) ; usort ( $ events , function ( $ a , $ b ) { return $ a -> getStart ( ) > $ b -> getStart ( ) ; } ) ; // Render the schedule. return new Response ( $ this -> templating -> render ( '@BkstgSchedule/Schedule/read.html.twig' , [ 'production' => $ production , 'schedule' => $ schedule , 'sorted_events' => $ events , ] ) ) ; }
Show a single schedule.

@param int                           $id              The schedule id.
@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 AccessDeniedException If the user has no access to view.

@return Response
Show a single schedule .