I figured it out:
$this->Genre->bindModel(array('hasAndBelongsToMany' => array('Movies'
=> array('className' => 'Movie', 'joinTable' => 'movies_genres',
'limit'=> '20, 20'))));
$genre = $this->Genre->find("name = 'comedy'");
But this doesn't really make me happy.
Now each and every time I want a subset of movies in a certain genre I
have to rewrite by association all over again.
Not to mention I also use 2 HABTM on the Person model ('actors' and
'directors'), a HABTM on Country, one on Language and probably a
couple more to come.
I'm from a ROR background, and I can't really call this very DRY
(don't repeat yourself).
What if I halfway through change the name of my join_table or even a
model. I have to make the changes in lots of different places. I'm not
waiting for that to happen.
So is there really no other way to make it much more simpler?
Dax
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---