MediaWiki REL1_37
DoctrineSchemaBuilder.php
Go to the documentation of this file.
1<?php
2
3namespace Wikimedia\Rdbms;
4
5use Doctrine\DBAL\Platforms\AbstractPlatform;
6use Doctrine\DBAL\Schema\Schema;
7
14
15 private $schema;
16 private $platform;
17
23 public function __construct( AbstractPlatform $platform ) {
24 $this->schema = new Schema();
25 $this->platform = $platform;
26 }
27
31 public function addTable( array $schema ) {
32 $this->addTableToSchema( $this->schema, $schema );
33 }
34
38 public function getSql() {
39 return $this->schema->toSql( $this->platform );
40 }
41
42}
__construct(AbstractPlatform $platform)
A builder object that take abstract schema definition and produces sql to create the tables.
addTable(array $schema)
An example of $schema value: [ 'name' => 'actor', 'columns' => [ [ 'actor_id', 'bigint',...
Interface SchemaBuilder that gets a definition and produces SQL based on RDBMS.
addTableToSchema(Schema $schema, array $schemaSpec)
trait DoctrineAbstractSchemaTrait
Trait for schema spec of doctrine-based abstract schema.