Propel API
Class

Database

class Database extends ScopedElement

A class for holding application data structures.

Methods

value getNamespace()

Get the value of the namespace.

from ScopedElement
setNamespace(v $v)

Set the value of the namespace.

from ScopedElement
value getPackage()

Get the value of package.

from ScopedElement
setPackage(v $v)

Set the value of package.

from ScopedElement
value getSchema()

Get the value of schema.

from ScopedElement
setSchema(v $v)

Set the value of schema.

from ScopedElement
__construct(string $name = null)

Constructs a new Database object.

PropelPlatformInterface getPlatform()

Returns the PropelPlatformInterface implementation for this database.

setPlatform(PropelPlatformInterface $platform)

Sets the PropelPlatformInterface implementation for this database.

getName()

Get the name of the Database

setName($name)

Set the name of the Database

value getBaseClass()

Get the value of baseClass.

setBaseClass(v $v)

Set the value of baseClass.

value getBasePeer()

Get the value of basePeer.

setBasePeer(v $v)

Set the value of basePeer.

value getDefaultIdMethod()

Get the value of defaultIdMethod.

setDefaultIdMethod(v $v)

Set the value of defaultIdMethod.

string getDefaultPhpNamingMethod()

Get the value of defaultPHPNamingMethod which specifies the method for converting schema names for table and column to PHP names.

setDefaultPhpNamingMethod(string $v)

Set the value of defaultPHPNamingMethod.

string getDefaultTranslateMethod()

Get the value of defaultTranslateMethod which specifies the method for translate validator error messages.

setDefaultStringFormat(string $defaultStringFormat)

Set the default string format for ActiveRecord objects in this Db.

string getDefaultStringFormat()

Get the default string format for ActiveRecord objects in this Db.

setDefaultTranslateMethod(string $v)

Set the value of defaultTranslateMethod.

boolean isHeavyIndexing()

Get the value of heavyIndexing.

boolean getHeavyIndexing()

Get the value of heavyIndexing.

setHeavyIndexing(boolean $v)

Set the value of heavyIndexing.

array getTables()

Return the list of all tables

integer countTables()

Return the number of tables in the database

array getTablesForSql()

Return the list of all tables that have a SQL representation

boolean hasTable(string $name, boolean $caseInsensitive = false)

Check whether the database has a table.

Table getTable(string $name, boolean $caseInsensitive = false)

Return the table with the specified name.

boolean hasTableByPhpName(string $phpName)

Check whether the database has a table.

Table getTableByPhpName(string $phpName)

Return the table with the specified phpName.

addTable($data)

An utility method to add a new table from an xml attribute.

setAppData(AppData $parent)

Set the parent of the database

getAppData()

Get the parent of the table

Domain addDomain(Domain|string $data)

Adds Domain object from <domain> tag.

Domain getDomain($domainName)

Get already configured Domain object by name.

getGeneratorConfig()

getBuildProperty($key)

Behavior addBehavior($bdata)

Adds a new Behavior to the database

Array getBehaviors()

Get the database behaviors

boolean hasBehavior(string $name)

check if the database has a behavior by name

Behavior getBehavior(string $name)

Get one database behavior by name

string getTablePrefix()

Get the table prefix for this database

Behavior getNextTableBehavior()

Get the next behavior on all tables, ordered by behavior priority, and skipping the ones that were already executed,

doFinalInitialization()

appendXml(DOMNode $node)

Details

in ScopedElement at line 71
public value getNamespace()

Get the value of the namespace.

Return Value

value of namespace.

in ScopedElement at line 80
public setNamespace(v $v)

Set the value of the namespace.

Parameters

v $v Value to assign to namespace.

in ScopedElement at line 96
public value getPackage()

Get the value of package.

Return Value

value of package.

in ScopedElement at line 105
public setPackage(v $v)

Set the value of package.

Parameters

v $v Value to assign to package.

in ScopedElement at line 118
public value getSchema()

Get the value of schema.

Return Value

value of schema.

in ScopedElement at line 127
public setSchema(v $v)

Set the value of schema.

Parameters

v $v Value to assign to schema.

at line 71
public __construct(string $name = null)

Constructs a new Database object.

Parameters

string $name

at line 99
public PropelPlatformInterface getPlatform()

Returns the PropelPlatformInterface implementation for this database.

Return Value

PropelPlatformInterface a Platform implementation

at line 109
public setPlatform(PropelPlatformInterface $platform)

Sets the PropelPlatformInterface implementation for this database.

Parameters

PropelPlatformInterface $platform A Platform implementation

at line 117
public getName()

Get the name of the Database

at line 125
public setName($name)

Set the name of the Database

Parameters

$name

at line 134
public value getBaseClass()

Get the value of baseClass.

Return Value

value of baseClass.

at line 143
public setBaseClass(v $v)

Set the value of baseClass.

Parameters

v $v Value to assign to baseClass.

at line 152
public value getBasePeer()

Get the value of basePeer.

Return Value

value of basePeer.

at line 161
public setBasePeer(v $v)

Set the value of basePeer.

Parameters

v $v Value to assign to basePeer.

at line 170
public value getDefaultIdMethod()

Get the value of defaultIdMethod.

Return Value

value of defaultIdMethod.

at line 179
public setDefaultIdMethod(v $v)

Set the value of defaultIdMethod.

Parameters

v $v Value to assign to defaultIdMethod.

at line 189
public string getDefaultPhpNamingMethod()

Get the value of defaultPHPNamingMethod which specifies the method for converting schema names for table and column to PHP names.

Return Value

string The default naming conversion used by this database.

at line 198
public setDefaultPhpNamingMethod(string $v)

Set the value of defaultPHPNamingMethod.

Parameters

string $v The default naming conversion for this database to use.

at line 208
public string getDefaultTranslateMethod()

Get the value of defaultTranslateMethod which specifies the method for translate validator error messages.

Return Value

string The default translate method.

at line 218
public setDefaultStringFormat(string $defaultStringFormat)

Set the default string format for ActiveRecord objects in this Db.

Parameters

string $defaultStringFormat Any of 'XML', 'YAML', 'JSON', or 'CSV'

at line 228
public string getDefaultStringFormat()

Get the default string format for ActiveRecord objects in this Db.

Return Value

string The default string format

at line 237
public setDefaultTranslateMethod(string $v)

Set the value of defaultTranslateMethod.

Parameters

string $v The default translate method to use.

at line 250
public boolean isHeavyIndexing()

Get the value of heavyIndexing.

This is a synonym for getHeavyIndexing().

Return Value

boolean Value of heavyIndexing.

See also

getHeavyIndexing()

at line 260
public boolean getHeavyIndexing()

Get the value of heavyIndexing.

Return Value

boolean Value of heavyIndexing.

at line 269
public setHeavyIndexing(boolean $v)

Set the value of heavyIndexing.

Parameters

boolean $v Value to assign to heavyIndexing.

at line 278
public array getTables()

Return the list of all tables

Return Value

array

at line 287
public integer countTables()

Return the number of tables in the database

Return Value

integer

at line 303
public array getTablesForSql()

Return the list of all tables that have a SQL representation

Return Value

array

at line 322
public boolean hasTable(string $name, boolean $caseInsensitive = false)

Check whether the database has a table.

Parameters

string $name the name of the table (e.g. 'my_table')
boolean $caseInsensitive Whether the check is case insensitive. False by default.

Return Value

boolean

at line 338
public Table getTable(string $name, boolean $caseInsensitive = false)

Return the table with the specified name.

Parameters

string $name The name of the table (e.g. 'my_table')
boolean $caseInsensitive Whether the check is case insensitive. False by default.

Return Value

Table a Table object or null if it doesn't exist

at line 356
public boolean hasTableByPhpName(string $phpName)

Check whether the database has a table.

Parameters

string $phpName the PHP Name of the table (e.g. 'MyTable')

Return Value

boolean

at line 366
public Table getTableByPhpName(string $phpName)

Return the table with the specified phpName.

Parameters

string $phpName the PHP Name of the table (e.g. 'MyTable')

Return Value

Table a Table object or null if it doesn't exist

at line 378
public addTable($data)

An utility method to add a new table from an xml attribute.

Parameters

$data

at line 420
public setAppData(AppData $parent)

Set the parent of the database

Parameters

AppData $parent

at line 428
public getAppData()

Get the parent of the table

at line 439
public Domain addDomain(Domain|string $data)

Adds Domain object from <domain> tag.

Parameters

Domain|string $data XML attributes (array) or Domain object.

Return Value

Domain

at line 460
public Domain getDomain($domainName)

Get already configured Domain object by name.

Parameters

$domainName

Return Value

Domain

at line 469
public getGeneratorConfig()

at line 478
public getBuildProperty($key)

Parameters

$key

at line 491
public Behavior addBehavior($bdata)

Adds a new Behavior to the database

Parameters

$bdata

Return Value

Behavior A behavior instance

at line 512
public Array getBehaviors()

Get the database behaviors

Return Value

Array of Behavior objects

at line 523
public boolean hasBehavior(string $name)

check if the database has a behavior by name

Parameters

string $name the behavior name

Return Value

boolean True if the behavior exists

at line 533
public Behavior getBehavior(string $name)

Get one database behavior by name

Parameters

string $name the behavior name

Return Value

Behavior a behavior object

at line 543
public string getTablePrefix()

Get the table prefix for this database

Return Value

string the table prefix

at line 554
public Behavior getNextTableBehavior()

Get the next behavior on all tables, ordered by behavior priority, and skipping the ones that were already executed,

Return Value

Behavior

at line 573
public doFinalInitialization()

at line 620
public appendXml(DOMNode $node)

Parameters

DOMNode $node

See also

XMLElement::appendXml(DOMNode)