class IndexRouteProvider in Elasticsearch Connector 8.6
Same name and namespace in other branches
- 8.7 src/Entity/IndexRouteProvider.php \Drupal\elasticsearch_connector\Entity\IndexRouteProvider
- 8.2 src/Entity/IndexRouteProvider.php \Drupal\elasticsearch_connector\Entity\IndexRouteProvider
- 8.5 src/Entity/IndexRouteProvider.php \Drupal\elasticsearch_connector\Entity\IndexRouteProvider
Provides routes for elasticsearch clusters.
Hierarchy
- class \Drupal\elasticsearch_connector\Entity\IndexRouteProvider implements EntityRouteProviderInterface
Expanded class hierarchy of IndexRouteProvider
1 file declares its use of IndexRouteProvider
- IndexRouteProviderTest.php in tests/
src/ Unit/ Entity/ IndexRouteProviderTest.php
File
- src/
Entity/ IndexRouteProvider.php, line 13
Namespace
Drupal\elasticsearch_connector\EntityView source
class IndexRouteProvider implements EntityRouteProviderInterface {
/**
* {@inheritdoc}
*/
public function getRoutes(EntityTypeInterface $entity_type) {
$route_collection = new RouteCollection();
// TODO: Permissions should be checked and implemented.
$route = (new Route('/admin/config/search/elasticsearch-connector/index/{elasticsearch_index}/delete'))
->addDefaults([
'_entity_form' => 'elasticsearch_index.delete',
'_title' => 'Delete index',
])
->setRequirement('_entity_access', 'elasticsearch_index.delete');
$route_collection
->add('entity.elasticsearch_index.delete_form', $route);
$route = (new Route('/admin/config/search/elasticsearch-connector/index/add'))
->addDefaults([
'_entity_form' => 'elasticsearch_index.default',
'_title' => 'Add index',
])
->setRequirement('_entity_create_access', 'elasticsearch_index');
$route_collection
->add('entity.elasticsearch_index.add_form', $route);
return $route_collection;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
IndexRouteProvider:: |
public | function |
Provides routes for entities. Overrides EntityRouteProviderInterface:: |