I got 3 tables:

Arcs
Transitions
Workitems

Transitions hasMany Arcs
Arcs belongsTo Transitions
Workitems belongTo Transitions
Transitions hasMany Workitems

So I have a query:

$arcs = $Model->findAll(array(
                        'Arc.workflow_id'               => $workflow_id,
                        'Arc.transition_id'             => $transition_id,
                        'Arc.place_id'                  => $place_id,
                        'Arc.direction'                 => 'IN'));


But of course I need:

LEFT JOIN Workitems ON (Workitems.workflow_id = '$workflow_id' AND
Workitems.transition_id = Arcs.transition_id)

I can't find much about finderQuery, but I think it can solve my
problem.

Workitem is linked to a Transition, and Arcs come out of a Transition,
So I image I should be querying the Transition model as it's id is
common to all three.

But err, mental block, any pointers?


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to