You are here

protected function AbstractSolrEntity::urlRouteParameters in Search API Solr 4.x

Same name and namespace in other branches
  1. 8.3 src/Entity/AbstractSolrEntity.php \Drupal\search_api_solr\Entity\AbstractSolrEntity::urlRouteParameters()

Gets an array of placeholders for this entity.

Individual entity classes may override this method to add additional placeholders if desired. If so, they should be sure to replicate the property caching logic.

Parameters

string $rel: The link relationship type, for example: canonical or edit-form.

Return value

array An array of URI placeholders.

Overrides EntityBase::urlRouteParameters

File

src/Entity/AbstractSolrEntity.php, line 240

Class

AbstractSolrEntity
Defines the abstract base class for Solr config entities.

Namespace

Drupal\search_api_solr\Entity

Code

protected function urlRouteParameters($rel) {
  $uri_route_parameters = parent::urlRouteParameters($rel);
  if ('collection' === $rel || 'disable-for-server' === $rel || 'enable-for-server' === $rel) {
    $uri_route_parameters['search_api_server'] = \Drupal::routeMatch()
      ->getRawParameter('search_api_server') ?: 'core_issue_2919648_workaround';
  }
  return $uri_route_parameters;
}