You are here

class SocialGroupRequestRouteSubscriber in Open Social 8.9

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_group/modules/social_group_request/src/Routing/SocialGroupRequestRouteSubscriber.php \Drupal\social_group_request\Routing\SocialGroupRequestRouteSubscriber
  2. 10.0.x modules/social_features/social_group/modules/social_group_request/src/Routing/SocialGroupRequestRouteSubscriber.php \Drupal\social_group_request\Routing\SocialGroupRequestRouteSubscriber
  3. 10.1.x modules/social_features/social_group/modules/social_group_request/src/Routing/SocialGroupRequestRouteSubscriber.php \Drupal\social_group_request\Routing\SocialGroupRequestRouteSubscriber
  4. 10.2.x modules/social_features/social_group/modules/social_group_request/src/Routing/SocialGroupRequestRouteSubscriber.php \Drupal\social_group_request\Routing\SocialGroupRequestRouteSubscriber

Class SocialGroupRequestRouteSubscriber.

Hierarchy

Expanded class hierarchy of SocialGroupRequestRouteSubscriber

1 string reference to 'SocialGroupRequestRouteSubscriber'
social_group_request.services.yml in modules/social_features/social_group/modules/social_group_request/social_group_request.services.yml
modules/social_features/social_group/modules/social_group_request/social_group_request.services.yml
1 service uses SocialGroupRequestRouteSubscriber
social_group_request.route_subscriber in modules/social_features/social_group/modules/social_group_request/social_group_request.services.yml
Drupal\social_group_request\Routing\SocialGroupRequestRouteSubscriber

File

modules/social_features/social_group/modules/social_group_request/src/Routing/SocialGroupRequestRouteSubscriber.php, line 13

Namespace

Drupal\social_group_request\Routing
View source
class SocialGroupRequestRouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) {
    if ($route = $collection
      ->get('grequest.request_membership')) {
      $route
        ->setDefaults([
        '_controller' => GroupRequestController::class . '::requestMembership',
      ]);
    }
    if ($route = $collection
      ->get('grequest.group_request_membership_approve')) {
      $route
        ->setDefaults([
        '_title_callback' => GroupRequestController::class . '::getTitleApproveRequest',
        '_controller' => GroupRequestController::class . '::approveRequest',
      ]);
    }
    if ($route = $collection
      ->get('grequest.group_request_membership_reject')) {
      $route
        ->setDefaults([
        '_title_callback' => GroupRequestController::class . '::getTitleRejectRequest',
        '_form' => GroupRequestMembershipRejectForm::class,
      ]);
    }
    if ($route = $collection
      ->get('view.group_pending_members.page_1')) {
      $route
        ->setRequirements([
        '_custom_access' => GroupRequestController::class . '::routeAccess',
      ]);
    }
    if ($route = $collection
      ->get('view.group_pending_members.membership_requests')) {
      $route
        ->setRequirements([
        '_custom_access' => GroupRequestController::class . '::routeAccess',
      ]);
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RouteSubscriberBase::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. 5
RouteSubscriberBase::onAlterRoutes public function Delegates the route altering to self::alterRoutes(). 1
SocialGroupRequestRouteSubscriber::alterRoutes protected function Alters existing routes for a specific collection. Overrides RouteSubscriberBase::alterRoutes