http://groups.google.com/group/cake-php/browse_thread/thread/21717ae54545aaa9/a092d6c27a291b91?#a092d6c27a291b91
With such approach I ordinary have problems only with save callbacks and need wrap above common save(), and do not have problems at all with find(). Also after model config change you may need to call $this- >setSource($this->useTable) to make saves work. On Aug 24, 4:19 pm, Marco Pietschmann <[email protected]> wrote: > Hi, > > got the following problem. > > Need to combine several tables from different datasources that are > associated to each other. So far so good. > > But I've got the following problem: > The data retreived from the default database defines which datasource > should be used. > > Example: > > Project belongsTo Customer belongsTo Address belongsTo Country > Project hasMany Invoices > > The Invoices are stored in different databases depending on the > Customers country. > > I tried different things with changing the datasource of the invoice > model, but since I set it with beforeFind the change only effects the > next query, not the current one and I had to start additional queries. > > Since also a list of projects on one view is needed I need a solution > that changes the datasource easily during runtime, not only once at > the beginning of the lifecycle. I need a possibility to change the > models datasource after loading the default data and before the data > of the associated model is loaded. > > Any ideas? > > Thanks a lot, > Marco --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
