Ensure that MySQLDatabase::tableList() always returns an array

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60607 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2008-08-13 03:54:04 +00:00
parent 26f3dc26da
commit ab6d6dd32f

View File

@ -368,11 +368,12 @@ class MySQLDatabase extends Database {
* @return array
*/
public function tableList() {
$tables = array();
foreach($this->query("SHOW TABLES") as $record) {
$table = strtolower(reset($record));
$tables[$table] = $table;
}
return isset($tables) ? $tables : null;
return $tables;
}
/**