My suggestion is to use two finds - the first to retrieve all the post id for the specified tag. The second to retrieve the post id which are NOT IN the first set of post id. Enjoy, John
On Oct 29, 7:07 pm, Toby Ashley <[email protected]> wrote: > Hello all, > > Assuming two hypothetical models, Post and Tag, joined with a HABTM > relationship, of course it's trivial to retrieve a list of all Posts which > are linked to a particular Tag. > > However, if I wanted to retrieve a list of all Posts which *are not* linked > to a particular Tag, what would be the best approach? > > Of course, I could first retrieve a list of all Posts, then retrieve a list > of Posts linked to the Tag, and then manually iterate through the array > 'removing' one from the other, but is there a better way? > > Grateful for any suggestions. > > Cheers, > toby --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~----------~----~----~----~------~----~------~--~---
