You are here

public function SearchApiDisplay::getPath in Facets 8

Returns the path of the facet source, used to build the facet url.

Return value

string The path.

Overrides FacetSourcePluginInterface::getPath

File

src/Plugin/facets/facet_source/SearchApiDisplay.php, line 138

Class

SearchApiDisplay
Provides a facet source based on a Search API display.

Namespace

Drupal\facets\Plugin\facets\facet_source

Code

public function getPath() {

  // The implementation in search api tells us that this is a base path only
  // if a path is defined, and false if that isn't done. This means that we
  // have to check for this + create our own uri if that's needed.
  if ($this
    ->getDisplay()
    ->getPath()) {
    return $this
      ->getDisplay()
      ->getPath();
  }
  return \Drupal::service('path.current')
    ->getPath();
}