I just ran a quick test (I've never actually needed to have more than one db config for the same app so far) and it works fine, even without the external bit.
It seems completely transparent, and it's only seeing the sql logs that you realise it does a separate query, not a join, for the external association. On Dec 11, 12:35 pm, Zwift <[EMAIL PROTECTED]> wrote: > After some researching I just need to know - is it even possible??? > Many people (on IRC) says: yes, sure > But hell I cannot make it work even with simples User <-> Profile > associacion (from tempdocs) > > On 11 Gru, 11:56, Zwift <[EMAIL PROTECTED]> wrote: > > > I think > > nothttp://api.cakephp.org/1.2/libs_2model_2model_8php-source.html(from > > line 260) > > > On 11 Gru, 11:44, grigri <[EMAIL PROTECTED]> wrote: > > > > If your models are using different datasources you have to set the > > > 'external' attribute in the association (I think). > > > > On Dec 11, 9:28 am, Zwift <[EMAIL PROTECTED]> wrote: > > > > > 2 Models > > > > FIRST: > > > > > class LocalNumber extends AppModel { > > > > var $useDbConfig = 'prepaid'; > > > > var $useTable = 'cards'; > > > > var $primaryKey = 'number'; > > > > var $displayField = 'number'; > > > > var $name = 'LocalNumber'; > > > > var $recursive = 2; > > > > > var $hasOne = array( > > > > 'LocalAccount' => array( > > > > 'ClassName' => 'LocalAccount', > > > > 'foreignKey' => 'local_number_id' > > > > ) > > > > ); > > > > > } > > > > > SECOND: > > > > class LocalAccount extends AppModel { > > > > > var $name = 'LocalAccount'; > > > > > var $belongsTo = array( > > > > 'LocalNumber' => array('className' => > > > > 'LocalNumber', > > > > 'foreignKey' => 'local_number_id') > > > > ); > > > > > } > > > > > And I have no idea why its not working - LocalNumber just doesn't > > > > appear in view (view and controller were baked). > > > > Any ideas? Maybe I did something wrong?? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~----------~----~----~----~------~----~------~--~---
