You are here

function search_api_saved_searches_unparse_keys in Search API Saved Searches 7

Reverses the search keywords parsing to get string keywords.

Parameters

array $keys: An array with search keys, as defined by SearchApiQueryInterface::getKeys().

Return value

string A guess regarding the original keys used to come up with the given keys array.

1 call to search_api_saved_searches_unparse_keys()
search_api_saved_searches_search_edit_form in ./search_api_saved_searches.pages.inc
Form builder for editing a saved search.

File

./search_api_saved_searches.pages.inc, line 250
User UI functions and form callbacks for saved searches.

Code

function search_api_saved_searches_unparse_keys(array $keys) {
  $simple_keys = array();
  foreach (element_children($keys) as $i) {
    $key = $keys[$i];
    if (is_scalar($key)) {
      if (strpos($key, ' ')) {
        $key = '"' . $key . '"';
      }
      $simple_keys[] = $key;
    }
  }
  return implode(' ', $simple_keys);
}