You are here

function hook_search_api_saved_search_create_name_alter in Search API Saved Searches 7

Alters the name assigned to a newly created saved search.

Parameters

string $name: The suggested name of the saved search. Likely the search term, or the translated string "Saved search".

array $query: An associative array with the following keys:

  • index_id: The machine name of the index the search was run on.
  • keys: The parsed search keys.
  • original_keys: The keys as entered by the user.
  • fields: The fulltext fields searched by the query.
  • filters: An array of filters set for the query, as returned by SearchApiQueryFilterInterface::getFilters().
  • options: All options set on the query.
1 invocation of hook_search_api_saved_search_create_name_alter()
_search_api_saved_searches_create_name in ./search_api_saved_searches.module
Helper function for creating a name for a saved search with the given query.

File

./search_api_saved_searches.api.php, line 249
Hooks provided by the Search API saved searches module.

Code

function hook_search_api_saved_search_create_name_alter(&$name, array $query) {
  $name = 'foo';
}