Re[2]: How add condition for associated model in findAll()

2006-08-16 Thread Michal Bilcik
Nazdar, 15. 8. 2006, Samuel DeVore napisal: some examples can be found at http://cakebaker.wordpress.com/2006/02/22/new-feature-bindmodelunbindmodel/ Sam D Thanks, it works: $this-WaypointType-bindModel(array('hasMany' = array('Waypoint' =array('foreignKey' = 'waypoint_type_id',

Re: Re[2]: How add condition for associated model in findAll()

2006-08-16 Thread Jon Bennett
In different situations in my application I need use different conditions in model assocciations and every time i must use bindModel or there is another way how to do it ? you could create multiple associations in your models (you can link the 2 same models using different names as many times

How add condition for associated model in findAll()

2006-08-15 Thread Michal Bilcik
Hello, I have 2 models connected with this associations: Waypoint belongsTo WaypointType WaypointType hasMany Waypoint I do this: $this-set('waypoint_types', $this-WaypointType-findAll()); It gives me all WaypointTypes with _all_ associated Waypoints. But I want obtain only associated

Re: How add condition for associated model in findAll()

2006-08-15 Thread [EMAIL PROTECTED]
use bindModel --~--~-~--~~~---~--~~ 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

Re: How add condition for associated model in findAll()

2006-08-15 Thread Samuel DeVore
some examples can be found at http://cakebaker.wordpress.com/2006/02/22/new-feature-bindmodelunbindmodel/Sam Dps it a great feature, but if you find yourself using it all the time you might want to think about adding conditions to the model files them self and undoing the conditions when you do