I successfully created two Views query plugins by learning from XML Views. My plugins query a YAML, and CSV file; they are both base view types on their own.
Now I want to learn how to join tables. (The following assumes a minimal views module skeleton called csv_views, I deleted the query plugin class I mentioned before.)
I thought of a fix table (i.e. a CSV file) that is queried without any additional features. I want to join it to a node table, let's say via title field, both in node (node title) and a column in the CSV file.
What do I need to define in mv csv_views.views.inc? For now it contains the following:
function csv_views_views_data() {
$data['csv']['table']['group'] = t('CSV');
$data['csv']['table']['join'] = array(
'node' => array(
'left_table' => 'node',
'left_field' => 'title',
'field' => 'title',
),
);
return $data;
}
Is a field handler necessary?
In which class is the table query execution method defined? Is there a views module I can examine to learn that?
AFAIK all modules which provide tables to be joined use real database tables.
I use Drupal 6 because that is the Drupal version required by XML Views works, but I want to know Drupal 7 too and I could also settle to views 2. I guess it's still the main Views version, right?