The quickest way that comes to mind is to explicitly invalidate (kill)
the cache file, as follows (all the model cache files are kept in
tmp/cache/models):
cache($pathToCacheFile, null, '-1 minute');
Then I think you might have to delete the in-memory copy of the
description out of the database
nate wrote:
> Yes and no. Cake automatically loads up the correct driver as long as
> you tell it the type of database you're connecting to, but using
> Model::execute forces you to write queries by hand, which means, you'd
> have to do your database-specific translation manually.
Thanks Nate -
Yes and no. Cake automatically loads up the correct driver as long as
you tell it the type of database you're connecting to, but using
Model::execute forces you to write queries by hand, which means, you'd
have to do your database-specific translation manually.
Unfortunately, none of Cake's data
Chris Hartjes wrote:
> I'm coming a little late to the party here, but I'm curious as to why
> you need to dynamically create tables?
The application allows users to create a custom-table from predfined
column types (e.g. text, image, file), and to specify which of those
columns should be "search
On 9/5/06, gorbster <[EMAIL PROTECTED]> wrote:
>
> Is it possible to dynamically create tables from within a Cake
> application, and then use the table with Cake's Model class?
>
I'm coming a little late to the party here, but I'm curious as to why
you need to dynamically create tables?
--
Chri
Using this option (Model::execute()), is it possible to take advantage
of the built-in DBO abstraction currently used in Cake? e.g. if I
wanted to specify generic column types when creating the table.
Thanks for the help so far,
-Brian
--~--~-~--~~~---~--~~
You
Option 3:
class AppModel extends Model {
function createTable($name = null) {
if($name) {
$this->execute('CREATE TABLE IF NOT EXISTS '.$name);
}
}
}
--~--~-~--~~~---~--~~
You received this message because you are subscribed
On Sep 5, 2006, at 10:11 AM, gorbster wrote:
>
> Is it possible to dynamically create tables from within a Cake
> application, and then use the table with Cake's Model class?
Make a generic model that doesn't use a table (var $useTable =
false), and use the execute() function of the model to
You can if you intercept the __construct( ) method of the controller
(or AppController), i.e.:
function __construct( ) {
$db =& ConnectionManager::getDataSource("default"); // Get database
connection reference
$db->execute("CREATE TABLE ...");
parent::__construct();
}
--~--~
Is it possible to dynamically create tables from within a Cake
application, and then use the table with Cake's Model class?
Thanks,
-Brian
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post
10 matches
Mail list logo