class SearchApiFederatedSolrRoutes in Search API Federated Solr 8
Same name and namespace in other branches
- 8.3 src/Routing/SearchApiFederatedSolrRoutes.php \Drupal\search_api_federated_solr\Routing\SearchApiFederatedSolrRoutes
- 8.2 src/Routing/SearchApiFederatedSolrRoutes.php \Drupal\search_api_federated_solr\Routing\SearchApiFederatedSolrRoutes
- 4.x src/Routing/SearchApiFederatedSolrRoutes.php \Drupal\search_api_federated_solr\Routing\SearchApiFederatedSolrRoutes
Defines a route subscriber to register a url for serving search pages.
Hierarchy
- class \Drupal\search_api_federated_solr\Routing\SearchApiFederatedSolrRoutes implements ContainerInjectionInterface
Expanded class hierarchy of SearchApiFederatedSolrRoutes
File
- src/
Routing/ SearchApiFederatedSolrRoutes.php, line 19 - Contains Drupal\search_api_federated_solr\Routing\SearchApiFederatedSolrRoutes.
Namespace
Drupal\search_api_federated_solr\RoutingView source
class SearchApiFederatedSolrRoutes implements ContainerInjectionInterface {
/**
* The entity manager service.
*
* @var \Drupal\Core\Entity\EntityManagerInterface
*/
protected $entityManager;
/**
* The language manager service.
*
* @var \Drupal\Core\Language\LanguageManagerInterface
*/
protected $languageManager;
/**
* Constructs a new SearchApiRoutes object.
*
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager service.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager service.
*/
public function __construct(EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager) {
$this->entityManager = $entity_manager;
$this->languageManager = $language_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container
->get('entity.manager'), $container
->get('language_manager'));
}
/**
* Returns an array of route objects.
*
* @return \Symfony\Component\Routing\Route[]
* An array of route objects.
*/
public function routes() {
$routes = [];
$app_config = \Drupal::config('search_api_federated_solr.search_app.settings');
$path = $app_config
->get('path') ?: '/search-app';
$args = [
'_controller' => 'Drupal\\search_api_federated_solr\\Controller\\SearchController::searchPage',
'_title' => 'Search',
];
$routes['search_api_federated_solr.search'] = new Route($path, $args, [
'_permission' => 'use federated search',
]);
return $routes;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SearchApiFederatedSolrRoutes:: |
protected | property | The entity manager service. | |
SearchApiFederatedSolrRoutes:: |
protected | property | The language manager service. | |
SearchApiFederatedSolrRoutes:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
|
SearchApiFederatedSolrRoutes:: |
public | function | Returns an array of route objects. | |
SearchApiFederatedSolrRoutes:: |
public | function | Constructs a new SearchApiRoutes object. |