You are here

public function SearchApiSpellcheckSuggestionLink::__construct in Search API Spellcheck 7

Constructor.

Parameters

SearchApiSpellcheckSuggestion $suggestion: Suggestion to create a link for.

string $method: A value to represent where the search key is in the url:

  • 'get': For the query string such as /search/?key=foo%20bar
  • 'arg': For an argument such as /search/foo%20bar

mixed $method_key: Where in the URL the search key is. This value is different depnding on $method:

  • For 'get' string: the query string field
  • For 'arg' int: the argument number

Overrides SearchApiSpellcheckSuggestion::__construct

File

includes/SearchApiSpellcheckSuggestionLink.inc, line 30
The class is a helpful way to provide both an updated search query link and access to all the link components for themers.

Class

SearchApiSpellcheckSuggestionLink
@file The class is a helpful way to provide both an updated search query link and access to all the link components for themers.

Code

public function __construct(SearchApiSpellcheckSuggestion $suggestion, $method, $method_key) {
  $this->original = $suggestion->original;
  $this->suggestion = $suggestion->suggestion;
  $this->method = $method;
  $this->method_key = $method_key;
  $this
    ->createPath();
  $this
    ->createQuery();
  $this
    ->createUrl();
  $this
    ->createLink();
}