hi, there's a manual here, where it's all quite well explained: http://manual.cakephp.org/ you will find interesting the part where they show all the Association stuff. The last topic in this chapter is about bindModel / unbindModel http://manual.cakephp.org/chapter/models
related to the HABTM filtering expects() http://bakery.cakephp.org/articles/view/an-improvement-to-unbindmodel-on-model-side unbindAll() http://othy.wordpress.com/2006/06/03/unbind-all-associations-except-some/ very useful functions, mostly to optimize big HABTM queries with multiple levels. spark On 7/2/07, BoSc <[EMAIL PROTECTED]> wrote: > > So, I have been looking for info myself, and I believe this is what is > called HABTM filtering. Any tutorials on how to use bindmodel? > > Because this isn't very clear to me :( > > > On Jul 2, 4:11 pm, BoSc <[EMAIL PROTECTED]> wrote: > > Basically what I would like to do, when calling the findAll method for > > the model Authors is giving where arguments that refer to another > > model then Authors. > > > > Suppose I have three tables > > > > *Authors > > > > have many (1:N) > > > > *Books > > > > have many (N:M) > > > > *categories > > > > If I would like to few all Books by a certain Author in a certain > > Category, how should I do this?? > > > > I would expect something similar to: $this->Author- > > > > >findAll('Books_categories.category_id = id_of_category_i_want'); > > > > But this doens't seem to work, I can only give wherestatements in the > > context of the table Authors. > > > > Any other approaches? > > > > > -- [livesets] http://djspark.com.br/ [web] http://sydi.net [filmes] http://melhoresfilmes.com.br --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
