Hi Guys,

I have a clients and a milestone model. A client hasMany milestones.
Milestones have many strategies.

In one of the finds in my Client model, I unbind the Strategy model
from the Milestone model, in order to rebind it but with certain
conditions:

Client.php:
--------------
                
$this->Milestone->unbindModel(array('hasMany'=>array('Strategy')));
                $this->Milestone->bindModel(array(
                                'hasMany' => array(
                                                'Strategy' => array(
                                                                'className' => 
'Strategy',
                                                                'foreignKey' => 
'milestone_id',
                                                                'order' => 
'sort_order ASC',
                                                                'conditions' => 
'Strategy.deleted = 0'
                                                        )
                                        )
                        ));

Some strategies within a milestone are set to "deleted" while others
are not. By default the milestone gathers all of it's strategies in a
find whether deleted or not. For this particular find, I only wanted
the strategies that were not deleted for each milestone.

The problem is that after this first find, the model bindings are not
resetting to what I have written in the MIlestone model, and it is
effecting the finds in my other functions that are fired within that
same request.

I have read about reset, but it defaults to true so I shouldn't have
to do anything. What am I doing wrong here?

Thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to