I've never found a good built in solution to this. Cake does generate
join queries so perhaps you can look at the output of the query in the
debugger and create conditions that would work with it (like what you
are suggesting above). Otherwise, write a custom join query and use
$this->Model->query($sql); to execute. More often than not, this is
what I do for complex conditions like this.
Dave
On Apr 28, 3:23 pm, Crazy <[EMAIL PROTECTED]> wrote:
> I am wondering if it is possible to give conditions over multiple
> related tables, currently I have this:
>
> Table series:
> - id
> - name
>
> Table genre_series:
> - serie_id
> - genre_id
>
> Table genres:
> - id
> - name
>
> Model is set up correctly with HABTM etc and when I do a findAll() I
> get the correct output.
> What I would like to do is something like this:
>
> findAll("Serie.name = 'somename' AND Genre.name = 'somegenre'");
>
> How do I get something like this?, or do I have to use a custom SQL
> query?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---