You are here

protected function GroupRouteContextTrait::getCurrentRouteMatch in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Context/GroupRouteContextTrait.php \Drupal\group\Context\GroupRouteContextTrait::getCurrentRouteMatch()

Gets the current route match object.

Return value

\Drupal\Core\Routing\RouteMatchInterface The current route match object.

1 call to GroupRouteContextTrait::getCurrentRouteMatch()
GroupRouteContextTrait::getGroupFromRoute in src/Context/GroupRouteContextTrait.php
Retrieves the group entity from the current route.

File

src/Context/GroupRouteContextTrait.php, line 38

Class

GroupRouteContextTrait
Trait to get the group entity from the current route.

Namespace

Drupal\group\Context

Code

protected function getCurrentRouteMatch() {
  if (!$this->currentRouteMatch) {
    $this->currentRouteMatch = \Drupal::service('current_route_match');
  }
  return $this->currentRouteMatch;
}