class RelationMap
RelationMap is used to model a database relationship.
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.
Constants
MANY_TO_ONE |
|
ONE_TO_MANY |
|
ONE_TO_ONE |
|
MANY_TO_MANY |
|
LOCAL_TO_FOREIGN |
|
LEFT_TO_RIGHT |
|
Methods
__construct(string $name)
Constructor. |
||
string |
getName()
Get the name of this relation. |
|
setPluralName($pluralName)
|
||
string |
getPluralName()
Get the plural name of this relation. |
|
setType(integer $type)
Set the type |
||
integer |
getType()
Get the type |
|
setLocalTable(TableMap $table)
Set the local table |
||
TableMap |
getLocalTable()
Get the local table |
|
setForeignTable(TableMap $table)
Set the foreign table |
||
TableMap |
getForeignTable()
Get the foreign table |
|
TableMap |
getLeftTable()
Get the left table of the relation |
|
TableMap |
getRightTable()
Get the right table of the relation |
|
addColumnMapping(ColumnMap $local, ColumnMap $foreign)
Add a column mapping |
||
Array |
getColumnMappings(int $direction = RelationMap::LOCAL_TO_FOREIGN)
Get an associative array mapping local column names to foreign column names The arrangement of the returned array depends on the $direction parameter: - If the value is RelationMap::LOCALTOFOREIGN, then the returned array is local => foreign - If the value is RelationMap::LEFTTORIGHT, then the returned array is left => right |
|
boolean |
isComposite()
Returns true if the relation has more than one column mapping |
|
int |
countColumnMappings()
Return the number of column mappings |
|
Array |
getLocalColumns()
Get the local columns |
|
Array |
getForeignColumns()
Get the foreign columns |
|
ColumnMap[] |
getLeftColumns()
Get the left columns of the relation |
|
ColumnMap[] |
getRightColumns()
Get the right columns of the relation |
|
setOnUpdate(string $onUpdate)
Set the onUpdate behavior |
||
integer |
getOnUpdate()
Get the onUpdate behavior |
|
setOnDelete(string $onDelete)
Set the onDelete behavior |
||
integer |
getOnDelete()
Get the onDelete behavior |
|
RelationMap |
getSymmetricalRelation()
Gets the symmetrical relation |
Details
at line 58
public
__construct(string $name)
Constructor.
at line 68
public string
getName()
Get the name of this relation.
at line 73
public
setPluralName($pluralName)
at line 83
public string
getPluralName()
Get the plural name of this relation.
at line 93
public
setType(integer $type)
Set the type
at line 103
public integer
getType()
Get the type
at line 113
public
setLocalTable(TableMap $table)
Set the local table
at line 123
public TableMap
getLocalTable()
Get the local table
at line 133
public
setForeignTable(TableMap $table)
Set the foreign table
at line 143
public TableMap
getForeignTable()
Get the foreign table
at line 153
public TableMap
getLeftTable()
Get the left table of the relation
at line 163
public TableMap
getRightTable()
Get the right table of the relation
at line 174
public
addColumnMapping(ColumnMap $local, ColumnMap $foreign)
Add a column mapping
at line 190
public Array
getColumnMappings(int $direction = RelationMap::LOCAL_TO_FOREIGN)
Get an associative array mapping local column names to foreign column names The arrangement of the returned array depends on the $direction parameter: - If the value is RelationMap::LOCALTOFOREIGN, then the returned array is local => foreign - If the value is RelationMap::LEFTTORIGHT, then the returned array is left => right
at line 212
public boolean
isComposite()
Returns true if the relation has more than one column mapping
at line 222
public int
countColumnMappings()
Return the number of column mappings
at line 232
public Array
getLocalColumns()
Get the local columns
at line 242
public Array
getForeignColumns()
Get the foreign columns
at line 252
public ColumnMap[]
getLeftColumns()
Get the left columns of the relation
at line 262
public ColumnMap[]
getRightColumns()
Get the right columns of the relation
at line 272
public
setOnUpdate(string $onUpdate)
Set the onUpdate behavior
at line 282
public integer
getOnUpdate()
Get the onUpdate behavior
at line 292
public
setOnDelete(string $onDelete)
Set the onDelete behavior
at line 302
public integer
getOnDelete()
Get the onDelete behavior
at line 314
public RelationMap
getSymmetricalRelation()
Gets the symmetrical relation