You are here

public function Suggestion::__construct in Search API Autocomplete 8

Constructs a Suggestion object.

Parameters

string|null $suggested_keys: (optional) The suggested keys.

\Drupal\Core\Url|null $url: (optional) The URL to redirect to.

string|null $prefix: (optional) The prefix for the suggestion.

string|null $label: (optional) The label for the suggestion.

string|null $suggestion_prefix: (optional) The suggested prefix.

string|null $user_input: (optional) The user input.

string|null $suggestion_suffix: (optional) The suggested suffix.

int|null $results_count: (optional) The estimated number of results.

array|null $render: (optional) The render array.

File

src/Suggestion/Suggestion.php, line 97

Class

Suggestion
Provides a value object meant to be used as result of suggestions.

Namespace

Drupal\search_api_autocomplete\Suggestion

Code

public function __construct($suggested_keys = NULL, Url $url = NULL, $prefix = NULL, $label = NULL, $suggestion_prefix = NULL, $user_input = NULL, $suggestion_suffix = NULL, $results_count = NULL, array $render = NULL) {
  $this->suggestedKeys = $suggested_keys;
  $this->url = $url;
  $this->prefix = $prefix;
  $this->label = $label;
  $this->suggestionPrefix = $suggestion_prefix;
  $this->userInput = $user_input;
  $this->suggestionSuffix = $suggestion_suffix;
  $this->resultsCount = $results_count;
  $this->render = $render;
}