function data_search_views_data_alter in Data 6
Same name and namespace in other branches
- 8 data_search/data_search.module \data_search_views_data_alter()
- 7 data_search/data_search.module \data_search_views_data_alter()
Implementation of hook_views_data_alter().
File
- data_search/
data_search.module, line 50
Code
function data_search_views_data_alter(&$data) {
$tables = data_search_get_tables();
foreach ($tables as $table) {
$name = $table
->get('name');
$schema = $table
->get('table_schema');
$base_field = current($schema['primary key']);
// Explain how the search index joins to data tables.
$data['search_index']['table']['join'][$name] = array(
'left_field' => $base_field,
'field' => 'sid',
);
$data['search_dataset']['table']['join'][$name] = array(
'left_table' => 'search_index',
'left_field' => 'sid',
'field' => 'sid',
'extra' => 'search_index.type = search_dataset.type',
'type' => 'INNER',
);
}
}