public static function getTables(DB $database) { $table_sql = 'SELECT "table_name", "table_type" FROM "information_schema"."tables" WHERE "table_schema" = ?'; $table_stmt = $database->getConnection()->prepare($table_sql); $table_stmt->execute(array($database->getSchema())); $tables = array(); while ($table_row = $table_stmt->fetch()) { $table = new DB\Table($database, $table_row['table_name']); $tables[$table_row['table_name']] = $table; } return $tables; }