You are here

public function Synonym::getLink in Google Search Appliance 8

Gets synonym as link.

Return value

\Drupal\Core\Link Link object.

File

src/SearchResults/Synonym.php, line 67

Class

Synonym
Defines a value object for a synonym.

Namespace

Drupal\google_appliance\SearchResults

Code

public function getLink() {
  return Link::fromTextAndUrl($this->description, Url::fromRoute(SearchViewRoute::ROUTE_NAME, [
    'search_query' => $this->url,
  ]));
}