hey Ian, I think so yes. I'm still getting my head around the proper use of the bind / unbind methods myself but that could be a use for it i'm sure.
cheers, freedom On 03/09/06, ianh <[EMAIL PROTECTED]> wrote: > > > If we use this hard-coded conditions in the model but want to override > it on a case-by-case basis (e.g. in an app I'm developing 'delete' > means set a boolean field to 1 so things can be undeleted by the admin) > is that a use for bind/unbind model? > > Thanks, Ian > > > Mikee Freedom wrote: > > Hey Felipe, > > > > If I understand you correctly, whenever you retrieve data about a > > MailList Model you would like to only grab the "Active" Email Models > > along with it. > > > > I think it is possible in defining your HABTM relationship to set > > conditions such as: > > > > "status = 'Active'" > > > > i.e. var $hasAndBelongsToMany = array ( > > 'Email' => array ( > > 'class' => 'Email', > > 'conditions' => 'status = \'Active\'' > > ) > > ); > > > > check this against the manual as I'm a little bit slow on this > > particular Sunday but I think you should be right. You can also do a > > similar thing with the bindModel() function to set these kind of > > conditions / relationships on the fly. > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---