public function SearchExtraTypeSearch::execute in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php \Drupal\search_extra_type\Plugin\Search\SearchExtraTypeSearch::execute()
Execute the search.
This is a dummy search, so when search "executes", we just return a dummy result containing the keywords and a list of conditions.
Return value
array A structured list of search results
Overrides SearchInterface::execute
1 call to SearchExtraTypeSearch::execute()
- SearchExtraTypeSearch::buildResults in core/
modules/ search/ tests/ modules/ search_extra_type/ src/ Plugin/ Search/ SearchExtraTypeSearch.php - Executes the search and builds render arrays for the result items.
File
- core/
modules/ search/ tests/ modules/ search_extra_type/ src/ Plugin/ Search/ SearchExtraTypeSearch.php, line 57 - Contains \Drupal\search_extra_type\Plugin\Search\SearchExtraTypeSearch.
Class
- SearchExtraTypeSearch
- Executes a dummy keyword search.
Namespace
Drupal\search_extra_type\Plugin\SearchCode
public function execute() {
$results = array();
if (!$this
->isSearchExecutable()) {
return $results;
}
return array(
array(
'link' => Url::fromRoute('test_page_test.test_page')
->toString(),
'type' => 'Dummy result type',
'title' => 'Dummy title',
'snippet' => SafeMarkup::format("Dummy search snippet to display. Keywords: @keywords\n\nConditions: @search_parameters", [
'@keywords' => $this->keywords,
'@search_parameters' => print_r($this->searchParameters, TRUE),
]),
),
);
}