You can try this way after database name retrieve:
// Copy default config values, usefull if dynamic config differs only
in one-two params
$config = $this-getDataSource()-config;
// Set new database name
$config['database'] = $target_database_name;
// Add new config to connections manager
what should I set as the default useDbConfig in my model?
Say I have a model called x. This model is located in database which
I dont know the name of when loading the model uses uses
I first know the database name after I query the first name where I
get the name of the database.
So should I
On Feb 16, 11:51 am, Henrik Gemal henrikge...@gmail.com wrote:
what should I set as the default useDbConfig in my model?
Say I have a model called x. This model is located in database which
I dont know the name of when loading the model uses uses
I first know the database name after I
In my controller I first need to query a database which holds
information about which database all of the models should use. I'm not
sure how to do this.
When the models get initialized by the uses array I haven't yet
determined what database they should use.
Any clue in which direction I
There is a property which is part of model called $useDbConfig.
From a controller you can call or set it like:
$this-model-setSource('mydbConfig');
To get the current model dbConfig call
currentconfig = $this-model-getDataSource();
If your storing your config info in database1. you would build