I have a content type 'contest' that users submit guesses on. The guesses are entities that have uid
and nid
properties (and of course their own primary key, gid
) to record the user and the contest to which they belong.
How can I display only contests on which a given user has submitted guesses? A similar problem might be how to return only nodes of a certain type that a given user has commented on.
By using this within hook_views_data
and setting the query to distinct (which I'd also prefer not to have to do) within the Views UI, I was able to confine the results to nodes that have guesses whose nid
property match - but I can't figure out how to confine the results to nodes with guess entities whose nid
AND uid
properties match:
$data['node']['nid'] = array(
'relationship' => array(
'handler' => 'views_handler_relationship',
'base' => 'entity_guess',
'base field' => 'nid',
'title' => t('Has guesses'),
'label' => t('contests with guesses'),
),
);
Thanks so much!