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(int $type)
Set the type |
||
int |
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::LOCAL_TO_FOREIGN, then the returned array is local => foreign - If the value is RelationMap::LEFT_TO_RIGHT, 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 |
|
ColumnMap[] |
getLocalColumns()
Get the local columns |
|
ColumnMap[] |
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 |
||
int |
getOnDelete()
Get the onDelete behavior |
|
RelationMap |
getSymmetricalRelation()
Gets the symmetrical relation |
Details
at line 70
public
__construct(string $name)
Constructor.
at line 80
public string
getName()
Get the name of this relation.
at line 85
public
setPluralName($pluralName)
at line 95
public string
getPluralName()
Get the plural name of this relation.
at line 105
public
setType(int $type)
Set the type
at line 115
public int
getType()
Get the type
at line 125
public
setLocalTable(TableMap $table)
Set the local table
at line 135
public TableMap
getLocalTable()
Get the local table
at line 145
public
setForeignTable(TableMap $table)
Set the foreign table
at line 155
public TableMap
getForeignTable()
Get the foreign table
at line 165
public TableMap
getLeftTable()
Get the left table of the relation
at line 175
public TableMap
getRightTable()
Get the right table of the relation
at line 186
public
addColumnMapping(ColumnMap $local, ColumnMap $foreign)
Add a column mapping
at line 201
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::LOCAL_TO_FOREIGN, then the returned array is local => foreign - If the value is RelationMap::LEFT_TO_RIGHT, then the returned array is left => right
at line 225
public boolean
isComposite()
Returns true if the relation has more than one column mapping
at line 235
public int
countColumnMappings()
Return the number of column mappings
at line 245
public ColumnMap[]
getLocalColumns()
Get the local columns
at line 255
public ColumnMap[]
getForeignColumns()
Get the foreign columns
at line 265
public ColumnMap[]
getLeftColumns()
Get the left columns of the relation
at line 275
public ColumnMap[]
getRightColumns()
Get the right columns of the relation
at line 285
public
setOnUpdate(string $onUpdate)
Set the onUpdate behavior
at line 295
public integer
getOnUpdate()
Get the onUpdate behavior
at line 305
public
setOnDelete(string $onDelete)
Set the onDelete behavior
at line 315
public int
getOnDelete()
Get the onDelete behavior
at line 325
public RelationMap
getSymmetricalRelation()
Gets the symmetrical relation