function data_search_get_fields in Data 8
Same name and namespace in other branches
- 6 data_search/data_search.module \data_search_get_fields()
- 7 data_search/data_search.module \data_search_get_fields()
Gather all fields for a particular table which should be added to the search index.
3 calls to data_search_get_fields()
- data_search_admin_form in data_search/
data_search.admin.inc - Views handler configuration form.
- data_search_get_tables in data_search/
data_search.module - Gather all tables which might be eligible for searching.
- data_search_update_index in data_search/
data_search.module - Implements hook_update_index().
File
- data_search/
data_search.module, line 189
Code
function data_search_get_fields($table) {
$fields = array();
$schema = $table
->get('table_schema');
$meta = $table
->get('meta');
foreach (array_keys($schema['fields']) as $field_name) {
if (!empty($meta['fields'][$field_name]['search'])) {
$fields[] = $field_name;
}
}
return $fields;
}