MediaWiki  master
Wikimedia\Rdbms\DoctrineSchemaBuilder Class Reference

@experimental @unstable More...

Inheritance diagram for Wikimedia\Rdbms\DoctrineSchemaBuilder:
Collaboration diagram for Wikimedia\Rdbms\DoctrineSchemaBuilder:

Public Member Functions

 __construct (AbstractPlatform $platform)
 A builder object that take abstract schema definition and produces sql to create the tables. More...
 
 addTable (array $schema)
 An example of $schema value: [ 'name' => 'actor', 'columns' => [ [ 'actor_id', 'bigint', [ 'Unsigned' => true, 'Notnull' => true ] ], [ 'actor_user', 'integer', [ 'Unsigned' => true ] ], [ 'actor_name', 'string', [ 'Length' => 255, 'Notnull' => true ] ], ], 'indexes' => [ [ 'actor_user', [ 'actor_user' ], 'unique' => true ], [ 'actor_name', [ 'actor_name' ], 'unique' => true ] ], 'pk' => [ 'actor_id' ] ],.
Parameters
array$schema
Returns
void
More...
 
 getSql ()
 
Returns
string[] SQLs to run
More...
 

Public Attributes

const TABLE_PREFIX = '/*_*/'
 

Private Attributes

 $platform
 
 $schema
 

Detailed Description

@experimental @unstable

Definition at line 13 of file DoctrineSchemaBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Rdbms\DoctrineSchemaBuilder::__construct ( AbstractPlatform  $platform)

A builder object that take abstract schema definition and produces sql to create the tables.

Parameters
AbstractPlatform$platformA Doctrine Platform object, Can be Mysql, Sqlite, etc.

Definition at line 24 of file DoctrineSchemaBuilder.php.

References Wikimedia\Rdbms\DoctrineSchemaBuilder\$platform, Wikimedia\Rdbms\TimestampType\TIMESTAMP, and Wikimedia\Rdbms\TinyIntType\TINYINT.

Member Function Documentation

◆ addTable()

Wikimedia\Rdbms\DoctrineSchemaBuilder::addTable ( array  $schema)

An example of $schema value: [ 'name' => 'actor', 'columns' => [ [ 'actor_id', 'bigint', [ 'Unsigned' => true, 'Notnull' => true ] ], [ 'actor_user', 'integer', [ 'Unsigned' => true ] ], [ 'actor_name', 'string', [ 'Length' => 255, 'Notnull' => true ] ], ], 'indexes' => [ [ 'actor_user', [ 'actor_user' ], 'unique' => true ], [ 'actor_name', [ 'actor_name' ], 'unique' => true ] ], 'pk' => [ 'actor_id' ] ],.

Parameters
array$schema
Returns
void

Implements Wikimedia\Rdbms\SchemaBuilder.

Definition at line 43 of file DoctrineSchemaBuilder.php.

References Wikimedia\Rdbms\DoctrineSchemaBuilder\$schema.

◆ getSql()

Wikimedia\Rdbms\DoctrineSchemaBuilder::getSql ( )

Returns
string[] SQLs to run

Implements Wikimedia\Rdbms\SchemaBuilder.

Definition at line 62 of file DoctrineSchemaBuilder.php.

Member Data Documentation

◆ $platform

Wikimedia\Rdbms\DoctrineSchemaBuilder::$platform
private

◆ $schema

Wikimedia\Rdbms\DoctrineSchemaBuilder::$schema
private

◆ TABLE_PREFIX

const Wikimedia\Rdbms\DoctrineSchemaBuilder::TABLE_PREFIX = '/*_*/'

Definition at line 17 of file DoctrineSchemaBuilder.php.


The documentation for this class was generated from the following file: