From: stronk7 Date: Wed, 6 Sep 2006 23:05:12 +0000 (+0000) Subject: Initial RenameTable caller to generators. Not ended by I needed it in CVS now. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=05a43ba36ce0103ae4f5c6f24f1c97c55b42f2c8;p=moodle.git Initial RenameTable caller to generators. Not ended by I needed it in CVS now. --- diff --git a/lib/xmldb/classes/XMLDBTable.class.php b/lib/xmldb/classes/XMLDBTable.class.php index ad70d8e0ff..9cc67d1d02 100644 --- a/lib/xmldb/classes/XMLDBTable.class.php +++ b/lib/xmldb/classes/XMLDBTable.class.php @@ -782,6 +782,24 @@ class XMLDBTable extends XMLDBObject { } return $results; } + + /** + * This function will return the SQL code needed to create the table for the specified DB and + * prefix. Just one simple wrapper over generators. + */ + function getRenameTableSQL ($dbtype, $prefix, $newname, $statement_end=true) { + + $results = array(); + + $classname = 'XMLDB' . $dbtype; + $generator = new $classname(); + $generator->setPrefix($prefix); + $results = $generator->getRenameTableSQL($this, $newname); + if ($statement_end) { + $results = $generator->getEndedStatements($results); + } + return $results; + } } ?>