public static function getTables(DB $database) { $table_sql = 'SELECT TABLE_NAME, ENGINE, TABLE_COLLATION, TABLE_COMMENT ' . 'FROM `information_schema`.`TABLES` WHERE `TABLE_SCHEMA` = ?;'; $table_stmt = $database->getConnection()->prepare($table_sql); $table_stmt->execute(array($database->getName())); $tables = array(); while ($table_row = $table_stmt->fetch()) { $table = new DB\Table($database, $table_row['TABLE_NAME'], $table_row['ENGINE'], $table_row['TABLE_COLLATION'], $table_row['TABLE_COMMENT']); $tables[$table_row['TABLE_NAME']] = $table; } return $tables; }