I need to make a temporary table (MySQL) to crunch some data then delete the table in one movement. I therefore need/would like to create a model extends CActiveRecord that can work with this table. Now as the table name will change for each call (it’s based on a user dependant variable) I need to specify the table name to the model dynamically. Can this be done?
In case you need some more background on why I am doing this it is due to working with a MSSQL db as well as a MySQL db. The data (rent transactions) will be taken from the MSSQL db, crunched, dumped to the temporary MySQL db, then back out again for further processing. The table name will vary as it will be based on the logged in user who is doing it as to avoid table name collisions.
This thread is a bit old, but just overriding the tableName method does not seem to do the trick. I also tried with a construct that took a parameter and changed a private property to a temporary name which was in turn returned by tableName.
It did not work either.
I ended up extending into another class and changing the tableName method there - that worked.