On Jun 19, 8:21 pm, "Daniel Dias" <[EMAIL PROTECTED]> wrote:
> Hi Dax.
>
> Or else, could you give me an example of how such a dynamic
>
> > bindModel() will look like?
>
> Thake a look at this article
>
> http://cakebaker.42dh.com/2006/02/22/new-feature-bindmodelunbindmodel/

Thanks for the link, it gave me a lot of information, but I'm still
stuck.

I have the following:

class Movie extends AppModel
{
  var $hasAndBelongsToMany = array('Genres' => array('className' =>
'Genre', 'joinTable' => 'movies_genres'));
}

class Genre extends AppModel
{
  var $hasAndBelongsToMany = array('Movies' => array('className' =>
'Movie', 'joinTable' => 'movies_genres'));
}

And now I want to have a list of Movies having a certain genre. For
which I use:
$this->Genre->Find("name = 'comedy");
And I get the genre info and all the movies having that genre.
But since there will be thousands of movies in a certain genre, that's
not really usefull.
I want only a subset of the movies in a certain genre, let's say
movies 20 to 40 having the genre 'comedy'.
I can't figure THAT one out.
I can see bindModel() lets you dynamically create associations at
runtime, but how does that solve what I want to do.

I hope there is a sollution to what I want.
Thanks

Dax


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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