You are here

protected function DeleteMultipleRouteProvider::deleteMultipleFormRoute in Entity API 8.0

Same name and namespace in other branches
  1. 8 src/Routing/DeleteMultipleRouteProvider.php \Drupal\entity\Routing\DeleteMultipleRouteProvider::deleteMultipleFormRoute()

Returns the delete multiple form route.

Parameters

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

Return value

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

1 call to DeleteMultipleRouteProvider::deleteMultipleFormRoute()
DeleteMultipleRouteProvider::getRoutes in src/Routing/DeleteMultipleRouteProvider.php
Provides routes for entities.

File

src/Routing/DeleteMultipleRouteProvider.php, line 41
Contains \Drupal\entity\Routing\DeleteMultipleRouteProvider.

Class

DeleteMultipleRouteProvider
Provides the HTML route for deleting multiple entities.

Namespace

Drupal\entity\Routing

Code

protected function deleteMultipleFormRoute(EntityTypeInterface $entity_type) {
  if ($entity_type
    ->hasLinkTemplate('delete-multiple-form')) {
    $route = new Route($entity_type
      ->getLinkTemplate('delete-multiple-form'));
    $route
      ->setDefault('_form', '\\Drupal\\entity\\Form\\DeleteMultiple');
    $route
      ->setDefault('entity_type_id', $entity_type
      ->id());
    $route
      ->setRequirement('_permission', $entity_type
      ->getAdminPermission());
    return $route;
  }
}