You are here

function search_api_nest_type in Search API 7

Utility function for nesting a type to the same level as another type. I.e., after <code>$t = search_api_nest_type($type, $nested_type);</code> is executed, the following statements will always be true:

search_api_list_nesting_level($t) == search_api_list_nesting_level($nested_type);
search_api_extract_inner_type($t) == search_api_extract_inner_type($type);

Parameters

$type: The type to wrap.

$nested_type: Another type, determining the nesting level.

Return value

string A list version of $type, as specified above.

4 calls to search_api_nest_type()
SearchApiAlterAddHierarchy::configurationFormSubmit in includes/callback_add_hierarchy.inc
Implements SearchApiAlterCallbackInterface::configurationFormSubmit().
SearchApiIndex::getFields in includes/index_entity.inc
Returns a list of all known fields for this index.
search_api_admin_index_fields_submit in ./search_api.admin.inc
Form submission handler for search_api_admin_index_fields().
_search_api_admin_get_fields in ./search_api.admin.inc
Helper function for building the field list for an index.

File

./search_api.module, line 2382
Provides a flexible framework for implementing search services.

Code

function search_api_nest_type($type, $nested_type) {
  while (search_api_is_list_type($nested_type)) {
    $nested_type = substr($nested_type, 5, -1);
    $type = "list<{$type}>";
  }
  return $type;
}