You are here

function search_api_list_nesting_level in Search API 7

Utility function for determining the nesting level of a list type.

Parameters

$type: A string containing the type to check.

Return value

int The nesting level of the type. 0 for singular types, 1 for lists of singular types, etc.

6 calls to search_api_list_nesting_level()
SearchApiIndex::getFields in includes/index_entity.inc
Returns a list of all known fields for this index.
SearchApiIndex::index in includes/index_entity.inc
Indexes items on this index.
SearchApiViewsHandlerFilterOptions::get_wrapper in contrib/search_api_views/includes/handler_filter_options.inc
Retrieves a wrapper for this filter's field.
search_api_admin_index_fields in ./search_api.admin.inc
Form constructor for setting the indexed fields.
search_api_views_views_data in contrib/search_api_views/search_api_views.views.inc
Implements hook_views_data().

... See full list

File

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

Code

function search_api_list_nesting_level($type) {
  $level = 0;
  while (search_api_is_list_type($type)) {
    $type = substr($type, 5, -1);
    ++$level;
  }
  return $level;
}