mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Implementing method in DboSqlite to avoid error while running the test suite
This commit is contained in:
parent
2e04c5260e
commit
cdc4cb9e1e
1 changed files with 18 additions and 0 deletions
|
@ -528,4 +528,22 @@ class DboSqlite extends DboSource {
|
|||
function hasResult() {
|
||||
return is_object($this->_result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a "drop table" statement for the given Schema object
|
||||
*
|
||||
* @param object $schema An instance of a subclass of CakeSchema
|
||||
* @param string $table Optional. If specified only the table name given will be generated.
|
||||
* Otherwise, all tables defined in the schema are generated.
|
||||
* @return string
|
||||
*/
|
||||
public function dropSchema(CakeSchema $schema, $table = null) {
|
||||
$out = '';
|
||||
foreach ($schema->tables as $curTable => $columns) {
|
||||
if (!$table || $table == $curTable) {
|
||||
$out .= 'DROP TABLE IF EXISTS ' . $this->fullTableName($curTable) . ";\n";
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue