proceed further with beans

This commit is contained in:
Jan-Niclas Loosen
2025-02-24 10:54:51 +01:00
parent 024e6e73cb
commit 239b81bf0e
10 changed files with 156 additions and 197 deletions

View File

@@ -5,31 +5,19 @@ use DatabaseHelper\beans\Schema;
class Database
{
/**
* Creates a new TableBlueprint instance for the specified table name.
* @param string $tableName The name of the table to create.
* @return Table instance supporting method chaining
*/
public static function makeTable(string $tableName): Table {
return new Table($tableName);
}
public static function makeMigration(Schema $table): Migration {
// TODO: Implement makeMigration() method.
return new Migration($table);
}
/**
* Creates a new QueryBuilder instance for the specified table.
* @param Schema $table The table to query on.
* @return Query instance supporting method chaining.
*/
public static function makeQuery(Schema $table): Query {
return new Query($table);
}
public static function makeDeletion(Schema $table): Deletion {
// TODO: Implement makeDeletion() method.
return new Deletion($table);
}
public static function makeInsertion(Schema $table): Insertion {
@@ -40,11 +28,6 @@ class Database
return new Update($table);
}
/**
* Adds the WordPress database prefix to table names if not already present.
* @param string ...$tableName Array of table names to process
* @return void
*/
public static function standardizeTableNames(string &...$tableName): void {
global $wpdb;
$dbPrefix = $wpdb->prefix;