Synonym.php in Google Search Appliance 8
File
src/SearchResults/Synonym.php
View source
<?php
namespace Drupal\google_appliance\SearchResults;
use Drupal\google_appliance\Routing\SearchViewRoute;
use Drupal\Core\Link;
use Drupal\Core\Url;
class Synonym {
protected $description;
protected $url;
public function __construct($description, $url) {
$this->description = $description;
$this->url = $url;
}
public function getDescription() {
return $this->description;
}
public function getUrl() {
return $this->url;
}
public function getLink() {
return Link::fromTextAndUrl($this->description, Url::fromRoute(SearchViewRoute::ROUTE_NAME, [
'search_query' => $this->url,
]));
}
}
Classes
Name |
Description |
Synonym |
Defines a value object for a synonym. |