The Views API in advanced help says "For Views to use your table, it has to either be a base table, or know how to link to an existing base table. Or sometimes both. "
I'm trying to add an "address" table to joins to the "person" table. The "person" table is a base table, "address" is not.
I can do this:
$data['address'] = array(
'table' => array(
'group' => t('Address'),
'join' => array(
'person' => array(
'left_field' => 'id',
'field' => 'personID',
),
),
),
);
However, this creates an implicit join relationship in views, meaning it will automatically make all fields in the "address" table available to the view and join the data with LEFT JOIN.
What I want to do is instead just add a relationship handler to the "personID" field so that the relationship is explicit, meaning a user must manually add the relationship.
I have successfully added this relationship handler to the "personID" field, and I can add the relationship. When adding the fields from this table, I can chose to use the relationship to add the field instead of the implicit relationship.
I want to completely remove the implicit relationship, and only allow users to add the data from the relationship handler. When I remove the 'join' data above, views won't allow me to add the relationship manually.
Is this possible? Or does that require that I define my joined table as a base table as well?