Re: Change database of models

2009-02-17 Thread Dr. Loboto
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

Re: Change database of models

2009-02-16 Thread Henrik Gemal
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

Re: Change database of models

2009-02-16 Thread AD7six
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

Change database of models

2009-02-13 Thread Henrik Gemal
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

Re: Change database of models

2009-02-13 Thread LunarDraco
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