| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace UserAccessManager\Setup\Database; |
| 6 |
|
| 7 |
class DatabaseObjectFactory |
| 8 |
{ |
| 9 |
/** |
| 10 |
* @throws MissingColumnsException |
| 11 |
*/ |
| 12 |
public function createTable(string $name, string $charsetCollate, array $columns): Table |
| 13 |
{ |
| 14 |
return new Table($name, $charsetCollate, $columns); |
| 15 |
} |
| 16 |
|
| 17 |
public function createColumn( |
| 18 |
string $name, |
| 19 |
string $type, |
| 20 |
bool $isNull = false, |
| 21 |
mixed $default = null, |
| 22 |
bool $isKey = false, |
| 23 |
bool $isAutoIncrement = false |
| 24 |
): Column { |
| 25 |
return new Column($name, $type, $isNull, $default, $isKey, $isAutoIncrement); |
| 26 |
} |
| 27 |
} |
| 28 |
|