Cactiverecord - Change Name Of Table To Be Used


I am creating a web app where a class will create a copy of table, to tablename_copy, populate the table, then change the table name back to the original name (minus the suffix "_copy").

I want to be able to change the model based on the original table to populate tablename_copy. Can this be done at runtime?

Any advice would be greatly appreciated.

Thanks in advance,


I used to try this method (through overriding tableName()), but at last got it done with Yii::app()->statePersister and arrays as temporary storage.