Re: Archive old data from model's table

2012-07-26 Thread gloop
Dud you try 1. $this-CakePHPModelName-setSource('table_name'); gloop On Thursday, July 26, 2012 5:57:52 AM UTC+2, baur79 wrote: i have high load on table reports so my idea to have (to divide) 2 tables 1 - actual data 2 - archved data with same logic and structure, can i

Re: Archive old data from model's table

2012-07-26 Thread Mike Griffin
On Wed, Jul 25, 2012 at 6:04 PM, baur79 bau...@gmail.com wrote: i have model Report with table reports it contain report of last month. (50 000 records every month) how can implement archive the data in another table with the same structure and logic. and manipulate reading in Model. in my

Re: Archive old data from model's table

2012-07-26 Thread baur79
i think about it, but it changes $report['Report']['id'] to $report[' table_name ']['id'] i wanna keep DRY logic in view, On Thursday, July 26, 2012 1:27:04 PM UTC+6, gloop wrote: Dud you try 1. $this-CakePHPModelName-setSource('table_name'); gloop On Thursday, July 26, 2012

Re: Archive old data from model's table

2012-07-26 Thread scs
Any reason not just use 2 models one for each? Than in your controller you can reuse the functions and just tell it which model you want use on the fly. function index($modelName) { $reports = $this-$modelName-find('all'); $this-set('report', $reports); } On Wednesday, July 25, 2012 1:04:32

Archive old data from model's table

2012-07-25 Thread baur79
i have model Report with table reports it contain report of last month. (50 000 records every month) how can implement archive the data in another table with the same structure and logic. and manipulate reading in Model. in my controller i want to (DRY): function index() { $reports =

Re: Archive old data from model's table

2012-07-25 Thread Andy Gale
On Wed, Jul 25, 2012 at 6:04 PM, baur79 bau...@gmail.com wrote: i have model Report with table reports it contain report of last month. (50 000 records every month) please give some suggestions These are called partitions. A quick Google came up with this:

Re: Archive old data from model's table

2012-07-25 Thread baur79
i have high load on table reports so my idea to have (to divide) 2 tables 1 - actual data 2 - archved data with same logic and structure, can i manupulate on fly the cakephp Model to read from another table ? but to keep model's name as same On Wednesday, July 25, 2012 11:59:54 PM UTC+6,