getDeleteMultipleFormRoute example

protected function getDeleteFormRoute(EntityTypeInterface $entity_type) {
    if ($route = parent::getDeleteFormRoute($entity_type)) {
      $route->setOption('_admin_route', TRUE);
      return $route;
    }
  }

  /** * {@inheritdoc} */
  protected function getDeleteMultipleFormRoute(EntityTypeInterface $entity_type) {
    if ($route = parent::getDeleteMultipleFormRoute($entity_type)) {
      $route->setOption('_admin_route', TRUE);
      return $route;
    }
  }

}
$collection->add("entity.{$entity_type_id}.edit_form", $edit_route);
    }

    if ($delete_route = $this->getDeleteFormRoute($entity_type)) {
      $collection->add("entity.{$entity_type_id}.delete_form", $delete_route);
    }

    if ($collection_route = $this->getCollectionRoute($entity_type)) {
      $collection->add("entity.{$entity_type_id}.collection", $collection_route);
    }

    if ($delete_multiple_route = $this->getDeleteMultipleFormRoute($entity_type)) {
      $collection->add('entity.' . $entity_type->id() . '.delete_multiple_form', $delete_multiple_route);
    }

    return $collection;
  }

  /** * Gets the add page route. * * Built only for entity types that have bundles. * * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type * The entity type. * * @return \Symfony\Component\Routing\Route|null * The generated route, if available. */
Home | Imprint | This part of the site doesn't use cookies.