Re: Conditions for multiple tables

2008-04-29 Thread [EMAIL PROTECTED]
Thanks Grigri, I've never tried that method, I'll have to check it out. It seems though like the dynamic bind model that you are setting up is just a mirror of the HasMany relationship that you had already setup in the model file. I wonder why then, it is necessary to give cake the same informatio

Re: Conditions for multiple tables

2008-04-29 Thread grigri
I do it like this : http://groups.google.com/group/cake-php/browse_thread/thread/863305f8a7267067 it works fine, even with lots of associated models. Doing `and` joins (series must have genre 'bacon' AND genre 'eggs') is more longwinded because you have to perform a separate join for each one, b

Re: Conditions for multiple tables

2008-04-29 Thread [EMAIL PROTECTED]
Yeah, I try to use the built in functionality as much as possible as well. I think that this particular issue is something that needs to be added in future releases though. I've tried using the bindmodel functions to add conditions to child models and then do a find on the parent but this doesn't

Re: Conditions for multiple tables

2008-04-29 Thread Crazy
Thanks, I'll do a custom query then :), want to use the build in functionallity of cakephp as much as possible :), still pretty new at it. On 29 apr, 00:17, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I've never found a good built in solution to this. Cake does generate > join queries so per

Re: Conditions for multiple tables

2008-04-28 Thread [EMAIL PROTECTED]
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

Conditions for multiple tables

2008-04-28 Thread Crazy
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. W