My plan is to create a temporary table using the $this->Model->query(); method then load it as a Model but I\'m getting an error staying \"Missing Database Table\". Turning
After doing google for an hour .. finally found a way to have Model on Temporary table and it works like a charm http://web2.0goodies.com/blog/uncategorized/mysql-temporary-tables-and-cakephp-1-3/
Ok, after looking around a bit I have found a solution that works. The problem was that Cake had already loaded the models caches at page load so used them as reference to the existence of a table. To resolve this problem I used "App::import('Model', $tmpModel);" which created the new modelCache allowing the loadModel script to run successfully.
$tmpModel = 'tempModel';
$tmpTable = 'temp_models';
$this->Model->query('CREATE TEMPORARY TABLE `'.$tmpTable ... );
App::import('Model', $tmpModel);
$this->loadModel($tmpModel);
Thanks anyway
$tmpModel = 'TempModel'; // CamelCase
also try, ClassRegisty::init($tmpModel);
final issue may be cache. but dont think so