It's difficult to say what's going on there. What are you trying to select? Maybe you should post an example of the data you want (please normalise tabs to spaces, though--this is really dificult to decipher). Also, the SQL that Cake is generating, for comparison.
You could also have a look at finderQuery(). That might be some help. On Tue, Mar 4, 2008 at 1:01 PM, teknoid <[EMAIL PROTECTED]> wrote: > > Hi, > I am using bindable behavior and trying to construct a conditional > query, by passing conditions to mutiple models. > For example, I have this query: > > $result = $this->User->find('all', array('restrict' => > array( 'Assignment' > => array('conditions' => > 'Assignment.IsAccepted=1', > 'fields' => > 'Assignment.UserID', > 'Document' => array('conditions' => > 'Document.ProfileID IN > (38)', > 'fields' => 'Document.ProfileID', > 'Item' => array('fields' => 'ItemProd.ItemInfoID', > 'ItemInfo' > => array('conditions' => > 'ItemInfo.ItemText LIKE "W > %"'))))))); > > The query will match and return the correct fields for each model, but > also this query returns "extra" data with empty arrays. For example it > will still return all users, even though their relevant > Assignment.IsAccepted does not equal to 1 (in that case it will simply > return an empty array for that user's assignment as part of the > overall resultset). Ideally it would be great to receive only the User > (and related models) only when all of the conditions in the above > query are met. > > What could be done to make that happen? > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---