class TableMap
TableMap is used to model a table in 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($name = null, $dbMap = null)
Construct a new TableMap. |
||
initialize()
Initialize the TableMap to build columns, relations, etc This method should be overridden by descendents |
||
setDatabaseMap(DatabaseMap $dbMap)
Set the DatabaseMap containing this TableMap. |
||
DatabaseMap |
getDatabaseMap()
Get the DatabaseMap containing this TableMap. |
|
setName(string $name)
Set the name of the Table. |
||
string |
getName()
Get the name of the Table. |
|
setPhpName(string $phpName)
Set the PHP name of the Table. |
||
string |
getPhpName()
Get the PHP name of the Table. |
|
setClassname(string $classname)
Set the Classname of the Table. |
||
string |
getClassname()
Get the Classname of the Propel Class belonging to this table. |
|
string |
getPeerClassname()
Get the Peer Classname of the Propel Class belonging to this table. |
|
setPackage(string $package)
Set the Package of the Table |
||
string |
getPackage()
Get the Package of the table. |
|
setUseIdGenerator(boolean $bit)
Set whether or not to use Id generator for primary key. |
||
boolean |
isUseIdGenerator()
Whether to use Id generator for primary key. |
|
setSingleTableInheritance(boolean $bit)
Set whether or not to this table uses single table inheritance |
||
boolean |
isSingleTableInheritance()
Whether this table uses single table inheritance |
|
setPrimaryKeyMethodInfo($pkInfo $pkInfo)
Sets the name of the sequence used to generate a key |
||
An |
getPrimaryKeyMethodInfo()
Get the name of the sequence used to generate a primary key |
|
ColumnMap |
addColumn($name, $phpName, $type, $isNotNull = false, $size = null, $defaultValue = null, $pk = false, $fkTable = null, $fkColumn = null)
Add a column to the table. |
|
ColumnMap |
addConfiguredColumn(ColumnMap $cmap)
Add a pre-created column to this table. |
|
boolean |
hasColumn(mixed $name, boolean $normalize = true)
Does this table contain the specified column? |
|
ColumnMap |
getColumn(string $name, boolean $normalize = true)
Get a ColumnMap for the table. |
|
boolean |
hasColumnByPhpName(mixed $phpName)
Does this table contain the specified column? |
|
ColumnMap |
getColumnByPhpName(string $phpName)
Get a ColumnMap for the table. |
|
hasColumnByInsensitiveCase($colName)
|
||
getColumnByInsensitiveCase($colName)
|
||
ColumnMap[] |
getColumns()
Get a ColumnMap[] of the columns in this table. |
|
ColumnMap |
addPrimaryKey(string $columnName, string $phpName, string $type, boolean $isNotNull = false, int $size = null, string $defaultValue = null)
Add a primary key column to this Table. |
|
ColumnMap |
addForeignKey(string $columnName, string $phpName, string $type, string $fkTable, string $fkColumn, boolean $isNotNull = false, int $size, string $defaultValue = null)
Add a foreign key column to the table. |
|
ColumnMap |
addForeignPrimaryKey(string $columnName, string $phpName, string $type, string $fkTable, string $fkColumn, boolean $isNotNull = false, int $size, string $defaultValue = null)
Add a foreign primary key column to the table. |
|
boolean |
isCrossRef()
|
|
setIsCrossRef(boolean $isCrossRef)
set the isCrossRef |
||
array |
getPrimaryKeys()
Returns array of ColumnMap objects that make up the primary key for this table |
|
array |
getForeignKeys()
Returns array of ColumnMap objects that are foreign keys for this table |
|
void |
addValidator(string $columnName, string $name, string $classname, string $value, string $message)
Add a validator to a table's column |
|
buildRelations()
Build relations Relations are lazy loaded for performance reasons This method should be overridden by descendents |
||
RelationMap |
addRelation(string $name, string $tablePhpName, integer $type, array $columnMapping = array(), string $onDelete = null, string $onUpdate = null, string $pluralName = null)
Adds a RelationMap to the table |
|
boolean |
hasRelation(String $name)
Gets a RelationMap of the table by relation name This method will build the relations if they are not built yet |
|
RelationMap |
getRelation(String $name)
Gets a RelationMap of the table by relation name This method will build the relations if they are not built yet |
|
RelationMap[] |
getRelations()
Gets the RelationMap objects of the table This method will build the relations if they are not built yet |
|
array |
getBehaviors()
Gets the list of behaviors registered for this table |
|
boolean |
hasPrimaryStringColumn()
Does this table has a primaryString column? |
|
ColumnMap|null |
getPrimaryStringColumn()
Gets the ColumnMap for the primary string column. |
|
boolean |
containsColumn(mixed $name, boolean $normalize = true)
Does this table contain the specified column? |
|
ColumnMap[] |
getPrimaryKeyColumns()
Returns array of ColumnMap objects that make up the primary key for this table. |
|
string |
getPrefix()
Get table prefix name. |
|
void |
setPrefix(string $prefix)
Set table prefix name. |
|
string |
removeUnderScores(string $data)
Removes the PREFIX, removes the underscores and makes first letter caps. |
Details
at line 101
public
__construct($name = null, $dbMap = null)
Construct a new TableMap.
at line 116
public
initialize()
Initialize the TableMap to build columns, relations, etc This method should be overridden by descendents
at line 125
public
setDatabaseMap(DatabaseMap $dbMap)
Set the DatabaseMap containing this TableMap.
at line 135
public DatabaseMap
getDatabaseMap()
Get the DatabaseMap containing this TableMap.
at line 145
public
setName(string $name)
Set the name of the Table.
at line 155
public string
getName()
Get the name of the Table.
at line 165
public
setPhpName(string $phpName)
Set the PHP name of the Table.
at line 175
public string
getPhpName()
Get the PHP name of the Table.
at line 186
public
setClassname(string $classname)
Set the Classname of the Table.
Could be useful for calling Peer and Object methods dynamically.
at line 196
public string
getClassname()
Get the Classname of the Propel Class belonging to this table.
at line 206
public string
getPeerClassname()
Get the Peer Classname of the Propel Class belonging to this table.
at line 216
public
setPackage(string $package)
Set the Package of the Table
at line 226
public string
getPackage()
Get the Package of the table.
at line 236
public
setUseIdGenerator(boolean $bit)
Set whether or not to use Id generator for primary key.
at line 246
public boolean
isUseIdGenerator()
Whether to use Id generator for primary key.
at line 256
public
setSingleTableInheritance(boolean $bit)
Set whether or not to this table uses single table inheritance
at line 266
public boolean
isSingleTableInheritance()
Whether this table uses single table inheritance
at line 276
public
setPrimaryKeyMethodInfo($pkInfo $pkInfo)
Sets the name of the sequence used to generate a key
at line 286
public An
getPrimaryKeyMethodInfo()
Get the name of the sequence used to generate a primary key
at line 306
public ColumnMap
addColumn($name, $phpName, $type, $isNotNull = false, $size = null, $defaultValue = null, $pk = false, $fkTable = null, $fkColumn = null)
Add a column to the table.
at line 340
public ColumnMap
addConfiguredColumn(ColumnMap $cmap)
Add a pre-created column to this table.
It will replace any existing column.
at line 355
public boolean
hasColumn(mixed $name, boolean $normalize = true)
Does this table contain the specified column?
at line 375
public ColumnMap
getColumn(string $name, boolean $normalize = true)
Get a ColumnMap for the table.
at line 394
public boolean
hasColumnByPhpName(mixed $phpName)
Does this table contain the specified column?
at line 407
public ColumnMap
getColumnByPhpName(string $phpName)
Get a ColumnMap for the table.
at line 416
public
hasColumnByInsensitiveCase($colName)
at line 421
public
getColumnByInsensitiveCase($colName)
at line 436
public ColumnMap[]
getColumns()
Get a ColumnMap[] of the columns in this table.
at line 453
public ColumnMap
addPrimaryKey(string $columnName, string $phpName, string $type, boolean $isNotNull = false, int $size = null, string $defaultValue = null)
Add a primary key column to this Table.
at line 472
public ColumnMap
addForeignKey(string $columnName, string $phpName, string $type, string $fkTable, string $fkColumn, boolean $isNotNull = false, int $size, string $defaultValue = null)
Add a foreign key column to the table.
at line 491
public ColumnMap
addForeignPrimaryKey(string $columnName, string $phpName, string $type, string $fkTable, string $fkColumn, boolean $isNotNull = false, int $size, string $defaultValue = null)
Add a foreign primary key column to the table.
at line 499
public boolean
isCrossRef()
at line 509
public
setIsCrossRef(boolean $isCrossRef)
set the isCrossRef
at line 519
public array
getPrimaryKeys()
Returns array of ColumnMap objects that make up the primary key for this table
at line 529
public array
getForeignKeys()
Returns array of ColumnMap objects that are foreign keys for this table
at line 545
public void
addValidator(string $columnName, string $name, string $classname, string $value, string $message)
Add a validator to a table's column
at line 567
public
buildRelations()
Build relations Relations are lazy loaded for performance reasons This method should be overridden by descendents
at line 584
public RelationMap
addRelation(string $name, string $tablePhpName, integer $type, array $columnMapping = array(), string $onDelete = null, string $onUpdate = null, string $pluralName = null)
Adds a RelationMap to the table
at line 624
public boolean
hasRelation(String $name)
Gets a RelationMap of the table by relation name This method will build the relations if they are not built yet
at line 638
public RelationMap
getRelation(String $name)
Gets a RelationMap of the table by relation name This method will build the relations if they are not built yet
at line 653
public RelationMap[]
getRelations()
Gets the RelationMap objects of the table This method will build the relations if they are not built yet
at line 669
public array
getBehaviors()
Gets the list of behaviors registered for this table
at line 679
public boolean
hasPrimaryStringColumn()
Does this table has a primaryString column?
at line 689
public ColumnMap|null
getPrimaryStringColumn()
Gets the ColumnMap for the primary string column.
at line 712
public boolean
containsColumn(mixed $name, boolean $normalize = true)
Does this table contain the specified column?
at line 738
public ColumnMap[]
getPrimaryKeyColumns()
Returns array of ColumnMap objects that make up the primary key for this table.
at line 758
public string
getPrefix()
Get table prefix name.
at line 773
public void
setPrefix(string $prefix)
Set table prefix name.
at line 818
final public string
removeUnderScores(string $data)
Removes the PREFIX, removes the underscores and makes first letter caps.
SCARABFOOBAR becomes FooBar.