Propel 2 API
Class

Propel\Generator\Model\Schema

class Schema

A class for holding application data structures.

Methods

__construct(PlatformInterface $platform = null)

Creates a new instance for the specified database type.

setPlatform(PlatformInterface $platform)

Sets the platform object to use for any databases added to this application schema.

PlatformInterface getPlatform()

Returns the platform object to use for any databases added to this application schema.

setGeneratorConfig(GeneratorConfigInterface $generatorConfig)

Sets the generator configuration

GeneratorConfigInterface getGeneratorConfig()

Returns the generator configuration

setName(string $name)

Sets the schema name.

string getName()

Returns the schema name.

string getShortName()

Returns the schema short name (without the '-schema' postfix).

array getDatabases(boolean $doFinalInitialization = true)

Returns an array of all databases.

boolean hasMultipleDatabases()

Returns whether or not this schema has multiple databases.

Database getDatabase(string $name = null, boolean $doFinalInitialization = true)

Returns the database according to the specified name.

boolean hasDatabase(string $name)

Returns whether or not a database with the specified name exists in this schema.

Database addDatabase(Database|array $database)

Adds a database to the list and sets the Schema property to this Schema.

doFinalInitialization()

Finalizes the databases initialization.

joinSchemas(array $schemas)

Merge other Schema objects together into this Schema object.

integer countTables()

Returns the number of tables in all the databases of this Schema object.

string toString()

Creates a string representation of this Schema.

__toString()

Magic string method

Details

at line 39
public __construct(PlatformInterface $platform = null)

Creates a new instance for the specified database type.

Parameters

PlatformInterface $platform

at line 55
public setPlatform(PlatformInterface $platform)

Sets the platform object to use for any databases added to this application schema.

Parameters

PlatformInterface $platform

at line 66
public PlatformInterface getPlatform()

Returns the platform object to use for any databases added to this application schema.

Return Value

PlatformInterface

at line 76
public setGeneratorConfig(GeneratorConfigInterface $generatorConfig)

Sets the generator configuration

Parameters

GeneratorConfigInterface $generatorConfig

at line 86
public GeneratorConfigInterface getGeneratorConfig()

Returns the generator configuration

at line 96
public setName(string $name)

Sets the schema name.

Parameters

string $name

at line 106
public string getName()

Returns the schema name.

Return Value

string

at line 116
public string getShortName()

Returns the schema short name (without the '-schema' postfix).

Return Value

string

at line 130
public array getDatabases(boolean $doFinalInitialization = true)

Returns an array of all databases.

The first boolean parameter tells whether or not to run the
final initialization process.

Parameters

boolean $doFinalInitialization

Return Value

array

at line 146
public boolean hasMultipleDatabases()

Returns whether or not this schema has multiple databases.

Return Value

boolean

at line 158
public Database getDatabase(string $name = null, boolean $doFinalInitialization = true)

Returns the database according to the specified name.

Parameters

string $name
boolean $doFinalInitialization

Return Value

Database

at line 188
public boolean hasDatabase(string $name)

Returns whether or not a database with the specified name exists in this schema.

Parameters

string $name

Return Value

boolean

at line 207
public Database addDatabase(Database|array $database)

Adds a database to the list and sets the Schema property to this Schema.

The database can be specified as a Database object or a
DOMNode object.

Parameters

Database|array $database

Return Value

Database

at line 236
public doFinalInitialization()

Finalizes the databases initialization.

at line 251
public joinSchemas(array $schemas)

Merge other Schema objects together into this Schema object.

Parameters

array $schemas

at line 288
public integer countTables()

Returns the number of tables in all the databases of this Schema object.

Return Value

integer

at line 304
public string toString()

Creates a string representation of this Schema.

The representation is given in xml format.

Return Value

string Representation in xml format

at line 325
public __toString()

Magic string method

See also

toString()