public function indexAction(
        Request $request,
        PaginatorInterface $paginator,
        TokenStorageInterface $token_storage
    ): Response {
        // Get the invitations repo and a list of pending invites for this user.
        $repo = $this->em->getRepository(Invitation::class);
        $query = $repo->findPendingInvitationsQuery($token_storage->getToken()->getUser());

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

        return new Response($this->templating->render(
            '@BkstgSchedule/Invitation/index.html.twig',
            ['invitations' => $invitations]
        ));
    }
public function indexAction(
        Request $request,
        PaginatorInterface $paginator,
        TokenStorageInterface $token_storage
    ): Response {
        // Get the invitations repo and a list of pending invites for this user.
        $repo = $this->em->getRepository(Invitation::class);
        $query = $repo->findPendingInvitationsQuery($token_storage->getToken()->getUser());

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

        return new Response($this->templating->render(
            '@BkstgSchedule/Invitation/index.html.twig',
            ['invitations' => $invitations]
        ));
    }
public function indexAction ( Request $ request , PaginatorInterface $ paginator , TokenStorageInterface $ token_storage ) : Response { // Get the invitations repo and a list of pending invites for this user. $ repo = $ this -> em -> getRepository ( Invitation :: class ) ; $ query = $ repo -> findPendingInvitationsQuery ( $ token_storage -> getToken ( ) -> getUser ( ) ) ; // Paginate and render the invitations. $ invitations = $ paginator -> paginate ( $ query , $ request -> query -> getInt ( 'page' , 1 ) ) ; return new Response ( $ this -> templating -> render ( '@BkstgSchedule/Invitation/index.html.twig' , [ 'invitations' => $ invitations ] ) ) ; }
Show a list of pending invitations for the current user.

@param Request               $request       The incoming request.
@param PaginatorInterface    $paginator     The paginator service.
@param TokenStorageInterface $token_storage The token storage service.

@return Response
Show a list of pending invitations for the current user .