proceed further with beans
This commit is contained in:
		
							
								
								
									
										21
									
								
								Database.php
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								Database.php
									
									
									
									
									
								
							@@ -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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user