Propel 2 API
Class

Propel\Runtime\Map\DatabaseMap

class DatabaseMap

DatabaseMap is used to model a database.

GENERAL NOTE
------------
The propel.map classes are abstract building-block classes for modeling
the database at runtime. These classes are similar (a lite version) to the
propel.engine.database.model classes, which are build-time modeling classes.
These classes in themselves do not do any database metadata lookups.

Methods

__construct(string $name)

Constructor.

string getName()

Get the name of this database.

TableMap addTable(string $tableName)

Add a new table to the database by name.

addTableObject(TableMap $table)

Add a new table object to the database.

TableMap addTableFromMapClass(string $tableMapClass)

Add a new table to the database, using the tablemap class name.

boolean hasTable(string $name)

Does this database contain this specific table?

TableMap getTable(string $name)

Get a TableMap for the table by name.

TableMap[] getTables()

Get a TableMap[] of all of the tables in the database.

ColumnMap getColumn($qualifiedColumnName $qualifiedColumnName)

Get a ColumnMap for the column by name.

getTableByPhpName($phpName)

AdapterInterface getAbstractAdapter()

Convenience method to get the AdapterInterface registered with Propel for this database.

Details

at line 58
public __construct(string $name)

Constructor.

Parameters

string $name Name of the database.

at line 68
public string getName()

Get the name of this database.

Return Value

string The name of the database.

at line 79
public TableMap addTable(string $tableName)

Add a new table to the database by name.

Parameters

string $tableName The name of the table.

Return Value

TableMap The newly created TableMap.

at line 91
public addTableObject(TableMap $table)

Add a new table object to the database.

Parameters

TableMap $table The table to add

at line 104
public TableMap addTableFromMapClass(string $tableMapClass)

Add a new table to the database, using the tablemap class name.

Parameters

string $tableMapClass The name of the table map to add

Return Value

TableMap The TableMap object

at line 122
public boolean hasTable(string $name)

Does this database contain this specific table?

Parameters

string $name The String representation of the table.

Return Value

boolean True if the database contains the table.

at line 138
public TableMap getTable(string $name)

Get a TableMap for the table by name.

Parameters

string $name Name of the table.

Return Value

TableMap A TableMap

Exceptions

TableNotFoundException If the table is undefined

at line 152
public TableMap[] getTables()

Get a TableMap[] of all of the tables in the database.

Return Value

TableMap[]

at line 165
public ColumnMap getColumn($qualifiedColumnName $qualifiedColumnName)

Get a ColumnMap for the column by name.

Name must be fully qualified, e.g. book.AUTHOR_ID

Parameters

$qualifiedColumnName $qualifiedColumnName Name of the column.

Return Value

ColumnMap A TableMap

Exceptions

TableNotFoundException If the table is undefined, or if the table is undefined

at line 172
public getTableByPhpName($phpName)

Parameters

$phpName

at line 207
public AdapterInterface getAbstractAdapter()

Convenience method to get the AdapterInterface registered with Propel for this database.

Return Value

AdapterInterface

See also

Propel::getServiceContainer()->getAdapter(string) .