Senser: go through the API doc for bindModel() and you'll see that the
changes you do through bindModel are only available for the next find()
operation, after which the model bindings get reset to their original state.
What you need is to tell bindModel not to reset it. On your behavior, change
this:
$model->bindModel(array('hasMany'=>$lang_model));
For this:
$model->bindModel(array('hasMany'=>$lang_model), false);
The API doc is:
http://api.cakephp.org/1.2/class_model.html#6b1a38f7a8ddb61cfa8539734b4d6430
-MI
---------------------------------------------------------------------------
CakeFest: December, 2008 - Buenos Aires, Argentina - http://es.cakefest.org
blog: http://www.MarianoIglesias.com.ar
twitter: http://twitter.com/mgiglesias
On Apr 26, 12:07 pm, senser <[EMAIL PROTECTED]> wrote:
> Very strange, but if I don't execute any query on Offer before,
> Categories are fetched OK, but if I run any query on Offer and other
> models (Category & Type) broke.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---