You are here

public function GroupContentListBuilder::__construct in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/Controller/GroupContentListBuilder.php \Drupal\group\Entity\Controller\GroupContentListBuilder::__construct()

Constructs a new GroupContentListBuilder object.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\Core\Routing\RedirectDestinationInterface $redirect_destination: The redirect destination.

\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match.

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type definition.

Overrides EntityListBuilder::__construct

File

src/Entity/Controller/GroupContentListBuilder.php, line 53

Class

GroupContentListBuilder
Provides a list controller for group content entities.

Namespace

Drupal\group\Entity\Controller

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager, RedirectDestinationInterface $redirect_destination, RouteMatchInterface $route_match, EntityTypeInterface $entity_type) {
  parent::__construct($entity_type, $entity_type_manager
    ->getStorage($entity_type
    ->id()));
  $this->entityTypeManager = $entity_type_manager;
  $this->redirectDestination = $redirect_destination;

  // There should always be a group on the route for group content lists.
  $this->group = $route_match
    ->getParameters()
    ->get('group');
}