Where conditions for hasAndBelongsToMany?

2006-06-22 Thread Matt
Hello everyone, Must say I am very impressed with CakePHP but I'm having trouble getting my head around associations, particularly hasAndBelongsToMany. The scenario is this, I've got two tables Users and Teams linked by a join table. When I return a team using Team-find sometimes I only want to

Re: Where conditions for hasAndBelongsToMany?

2006-06-22 Thread Samuel DeVore
Have you looked in the model chapter of the manual http://manual.cakephp.org/chapter/6 you are looking for the section on adding conditions. For example one thing that I have as a condition is flActive=true Sam DOn 6/22/06, Matt [EMAIL PROTECTED] wrote: Hello everyone,Must say I am very impressed

Re: Where conditions for hasAndBelongsToMany?

2006-06-22 Thread Samuel DeVore
then what you are probably looking for is bindModel and unbindModel look at some of the listings at http://cakephp.org/search?q=bindModel (cakebaker has a nice overview) you can also have conditions in your findAll and find calls Sam DOn 6/22/06, Matt [EMAIL PROTECTED] wrote: Hi Samuel,I saw that

Re: Where conditions for hasAndBelongsToMany?

2006-06-22 Thread DJ Spark
not something like this ? $this-MyModel-find('MyModel.parent_id = 0'); this should return only those MyModel (and associated Models, depending on the $recursive depth) that respect this specific condition. spark On 6/22/06, Matt [EMAIL PROTECTED] wrote: Hi Samuel, I saw that section