Welcome Guest, Not a member yet? Register   Sign In
Datamapper with multiple tables
#2

[eluser]WanWizard[/eluser]
Datamapper uses $this->table internally, so resetting this property should be sufficient to swap tables.

This will work if all tables are defined EXACTLY the same, all part of the same database, and if the model doesn't have any relations (as the table names are part of internal relationship definitions).

There is no need to use reinitialize_model(), that will only re-apply the config.


Messages In This Thread
Datamapper with multiple tables - by El Forum - 04-17-2012, 11:38 AM
Datamapper with multiple tables - by El Forum - 04-17-2012, 01:00 PM
Datamapper with multiple tables - by El Forum - 04-17-2012, 02:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB