You are here

protected function GroupContentRouteProvider::getDeleteFormRoute in Group 2.0.x

Same name and namespace in other branches
  1. 8 src/Entity/Routing/GroupContentRouteProvider.php \Drupal\group\Entity\Routing\GroupContentRouteProvider::getDeleteFormRoute()

Gets the delete-form route.

Parameters

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

Return value

\Symfony\Component\Routing\Route|null The generated route, if available.

Overrides DefaultHtmlRouteProvider::getDeleteFormRoute

File

src/Entity/Routing/GroupContentRouteProvider.php, line 170

Class

GroupContentRouteProvider
Provides routes for group content.

Namespace

Drupal\group\Entity\Routing

Code

protected function getDeleteFormRoute(EntityTypeInterface $entity_type) {
  return parent::getDeleteFormRoute($entity_type)
    ->setRequirement('_group_owns_content', 'TRUE')
    ->setOption('_group_operation_route', TRUE)
    ->setOption('parameters', [
    'group' => [
      'type' => 'entity:group',
    ],
    'group_content' => [
      'type' => 'entity:group_content',
    ],
  ]);
}