| 1 |
<?php |
| 2 |
|
| 3 |
namespace Wikimedia\Rdbms; |
| 4 |
|
| 5 |
use Doctrine\DBAL\Platforms\AbstractPlatform; |
| 6 |
use Doctrine\DBAL\Schema\Schema; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
class DoctrineSchemaBuilder implements SchemaBuilder { |
| 13 |
use DoctrineAbstractSchemaTrait; |
| 14 |
|
| 15 |
private Schema $schema; |
| 16 |
private AbstractPlatform $platform; |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
public function __construct( AbstractPlatform $platform ) { |
| 24 |
$this->schema = new Schema(); |
| 25 |
$this->platform = $platform; |
| 26 |
} |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
public function addTable( array $schema ) { |
| 32 |
$this->addTableToSchema( $this->schema, $schema ); |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
public function getSql() { |
| 39 |
return $this->schema->toSql( $this->platform ); |
| 40 |
} |
| 41 |
|
| 42 |
} |