On Jun 19, 7:20 pm, "John David Anderson (_psychic_)"
<[EMAIL PROTECTED]> wrote:
> On Jun 19, 2007, at 11:11 AM, daxhuiberts wrote:
> >
> > Hello,
> >
> > I have a HABTM association between 'movies' and 'genres'. All works
> > fine 'n stuff.
> > Now I want a list of movies by a specific genre, on which I do $this-
> >> Genre->find("name = '".$name."'"). So far so good.
> > But since there will be thousands, possibly a couple tenthousand
> > movies in the database, I really do not want ALL the movies. Using
> > offset, page to grab a bit each time.
> > Now is the question, HOW?
>
> > Since the 'movies' table doesn't contain the genre_id I want to filter
> > on, how can I do a find on movies on a certain genre. As far as I can
> > see, I can't. Not without writing manual queries. Or am I wrong here?
>
> You can use bindModel() to create model associations (like
> conditional HABTM) on the fly - have you looked into that?

I don't quite understand how exactly. How does that make it possible
to get a paginated list of movies by a specific genre id.
I can see it makes it possible to dynamically give a condition and a
limit, but no offset/page so I can implement what I need.

Or else, could you give me an example of how such a dynamic
bindModel() will look like?

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to