Propel 2 API
Class

Propel\Runtime\ActiveQuery\ModelJoin

class ModelJoin extends Join

A ModelJoin is a Join object tied to a RelationMap object

Constants

EQUAL

INNER_JOIN

Methods

__construct(string $leftColumn = null, string $rightColumn = null, string $joinType = null)

Constructor Use it preferably with no arguments, and then use addCondition() and setJoinType() Syntax with arguments used mainly for backwards compatibility

from Join
addCondition(string $left, string $right, string $operator = self::EQUAL)

Join condition definition.

from Join
addConditions(array $lefts, array $rights, array $operators = array())

Join condition definition, for several conditions

from Join
addExplicitCondition(string $leftTableName, string $leftColumnName, string $leftTableAlias = null, string $rightTableName = null, string $rightColumnName = null, string $rightTableAlias = null, string $operator = self::EQUAL)

Join condition definition.

from Join
integer countConditions()

Retrieve the number of conditions in the join

from Join
array getConditions()

Return an array of the join conditions

from Join
addOperator(string $operator = null)

from Join
string[] getOperator($index)

from Join
getOperators()

from Join
setJoinType(string $joinType = null)

Set the join type

from Join
string getJoinType()

Get the join type

from Join
addLeftColumnName(string $left)

Add a left column name to the join condition

from Join
string getLeftColumn(integer $index)

Get the fully qualified name of the left column of the join condition

from Join
string getLeftColumnName(integer $index)

Get the left column name of the join condition

from Join
array getLeftColumns()

Get the list of all the names of left columns of the join condition

from Join
setLeftTableName($leftTableName)

from Join
getLeftTableName()

from Join
setLeftTableAlias($leftTableAlias)

from Join
getLeftTableAlias()

from Join
hasLeftTableAlias()

from Join
getLeftTableAliasOrName()

from Join
getLeftTableWithAlias()

from Join
addRightColumnName(string $right)

Add a right column name to the join condition

from Join
string getRightColumn(integer $index)

Get the fully qualified name of the right column of the join condition

from Join
string getRightColumnName(integer $index)

Get the right column name of the join condition

from Join
all getRightColumns()

from Join
setRightTableName($rightTableName)

from Join
getRightTableName()

from Join
setRightTableAlias($rightTableAlias)

from Join
getRightTableAlias()

from Join
hasRightTableAlias()

from Join
getRightTableAliasOrName()

from Join
getRightTableWithAlias()

from Join
AdapterInterface getAdapter()

Get the adapter.

from Join
void setAdapter(AdapterInterface $db)

Set the adapter.

from Join
setJoinCondition(AbstractCriterion $joinCondition)

Set a custom join condition

from Join
AbstractCriterion getJoinCondition()

Get the custom join condition, if previously set

from Join
buildJoinCondition(Criteria $c)

Set the custom join condition Criterion based on the conditions of this join

from Join
string getClause(array $params)

Get the join clause for this Join.

from Join
equals($join)

string toString()

Returns a string representation of the class,

from Join
__toString()

setRelationMap(RelationMap $relationMap, $leftTableAlias = null, $relationAlias = null)

getRelationMap()

ModelJoin setTableMap(TableMap $tableMap)

Sets the right tableMap for this join

TableMap getTableMap()

Gets the right tableMap for this join

setPreviousJoin(ModelJoin $join)

getPreviousJoin()

isPrimary()

setRelationAlias($relationAlias)

getRelationAlias()

hasRelationAlias()

Object getObjectToRelate(Object $startObject)

This method returns the last related, but already hydrated object up until this join Starting from $startObject and continuously calling the getters to get to the base object for the current join.

Details

in Join at line 79
public __construct(string $leftColumn = null, string $rightColumn = null, string $joinType = null)

Constructor Use it preferably with no arguments, and then use addCondition() and setJoinType() Syntax with arguments used mainly for backwards compatibility

Parameters

string $leftColumn The left column of the join condition (may contain an alias name)
string $rightColumn The right column of the join condition (may contain an alias name)
string $joinType The type of the join. Valid join types are null (implicit join), Criteria::LEFT_JOIN, Criteria::RIGHT_JOIN, and Criteria::INNER_JOIN

in Join at line 106
public addCondition(string $left, string $right, string $operator = self::EQUAL)

Join condition definition.

Warning: doesn't support table aliases. Use the explicit methods to use aliases.

Parameters

string $left The left column of the join condition (may contain an alias name)
string $right The right column of the join condition (may contain an alias name)
string $operator The comparison operator of the join condition, default Join::EQUAL

in Join at line 131
public addConditions(array $lefts, array $rights, array $operators = array())

Join condition definition, for several conditions

Parameters

array $lefts The left columns of the join condition
array $rights The right columns of the join condition
array $operators The comparison operators of the join condition, default Join::EQUAL

in Join at line 161
public addExplicitCondition(string $leftTableName, string $leftColumnName, string $leftTableAlias = null, string $rightTableName = null, string $rightColumnName = null, string $rightTableAlias = null, string $operator = self::EQUAL)

Join condition definition.

Parameters

string $leftTableName
string $leftColumnName
string $leftTableAlias
string $rightTableName
string $rightColumnName
string $rightTableAlias
string $operator The comparison operator of the join condition, default Join::EQUAL

in Join at line 178
public integer countConditions()

Retrieve the number of conditions in the join

Return Value

integer The number of conditions in the join

in Join at line 188
public array getConditions()

Return an array of the join conditions

Return Value

array An array of arrays representing (left, comparison, right) for each condition

in Join at line 205
public addOperator(string $operator = null)

Parameters

string $operator the comparison operator for the join condition

in Join at line 213
public string[] getOperator($index)

Parameters

$index

Return Value

string[] the comparison operator for the join condition

in Join at line 218
public getOperators()

in Join at line 230
public setJoinType(string $joinType = null)

Set the join type

Parameters

string $joinType The type of the join. Valid join types are null (adding the join condition to the where clause), Criteria::LEFT_JOIN(), Criteria::RIGHT_JOIN(), and Criteria::INNER_JOIN()

in Join at line 241
public string getJoinType()

Get the join type

Return Value

string The type of the join, i.e. Criteria::LEFT_JOIN(), ..., or null for adding the join condition to the where Clause

in Join at line 256
public addLeftColumnName(string $left)

Add a left column name to the join condition

Parameters

string $left The name of the left column to add

in Join at line 272
public string getLeftColumn(integer $index)

Get the fully qualified name of the left column of the join condition

Parameters

integer $index The number of the condition to use

Return Value

string

in Join at line 290
public string getLeftColumnName(integer $index)

Get the left column name of the join condition

Parameters

integer $index The number of the condition to use

Return Value

string

in Join at line 299
public array getLeftColumns()

Get the list of all the names of left columns of the join condition

Return Value

array

in Join at line 309
public setLeftTableName($leftTableName)

Parameters

$leftTableName

in Join at line 316
public getLeftTableName()

in Join at line 321
public setLeftTableAlias($leftTableAlias)

Parameters

$leftTableAlias

in Join at line 328
public getLeftTableAlias()

in Join at line 333
public hasLeftTableAlias()

in Join at line 338
public getLeftTableAliasOrName()

in Join at line 343
public getLeftTableWithAlias()

in Join at line 358
public addRightColumnName(string $right)

Add a right column name to the join condition

Parameters

string $right The name of the right column to add

in Join at line 374
public string getRightColumn(integer $index)

Get the fully qualified name of the right column of the join condition

Parameters

integer $index The number of the condition to use

Return Value

string

in Join at line 392
public string getRightColumnName(integer $index)

Get the right column name of the join condition

Parameters

integer $index The number of the condition to use

Return Value

string

in Join at line 400
public all getRightColumns()

Return Value

all right columns of the join condition

in Join at line 410
public setRightTableName($rightTableName)

Parameters

$rightTableName

in Join at line 417
public getRightTableName()

in Join at line 422
public setRightTableAlias($rightTableAlias)

Parameters

$rightTableAlias

in Join at line 429
public getRightTableAlias()

in Join at line 434
public hasRightTableAlias()

in Join at line 439
public getRightTableAliasOrName()

in Join at line 444
public getRightTableWithAlias()

in Join at line 456
public AdapterInterface getAdapter()

Get the adapter.

The AdapterInterface which might be used to get db specific
variations of sql.

Return Value

AdapterInterface value of db.

in Join at line 468
public void setAdapter(AdapterInterface $db)

Set the adapter.

The AdapterInterface might be used to get db specific variations of sql.

Parameters

AdapterInterface $db Value to assign to db.

Return Value

void

in Join at line 478
public setJoinCondition(AbstractCriterion $joinCondition)

Set a custom join condition

Parameters

AbstractCriterion $joinCondition a Join condition

in Join at line 488
public AbstractCriterion getJoinCondition()

Get the custom join condition, if previously set

Return Value

AbstractCriterion

in Join at line 498
public buildJoinCondition(Criteria $c)

Set the custom join condition Criterion based on the conditions of this join

Parameters

Criteria $c A Criteria object to get Criterions from

in Join at line 529
public string getClause(array $params)

Get the join clause for this Join.

If the join condition needs binding, uses the passed params array.

Parameters

array $params &$params

Return Value

string SQL join clause with join condition

at line 132
public equals($join)

Parameters

$join

in Join at line 569
public string toString()

Returns a string representation of the class,

Return Value

string A string representation of the object

at line 141
public __toString()

at line 27
public setRelationMap(RelationMap $relationMap, $leftTableAlias = null, $relationAlias = null)

Parameters

RelationMap $relationMap
$leftTableAlias
$relationAlias

at line 43
public getRelationMap()

at line 55
public ModelJoin setTableMap(TableMap $tableMap)

Sets the right tableMap for this join

Parameters

TableMap $tableMap The table map to use

Return Value

ModelJoin The current join object, for fluid interface

at line 67
public TableMap getTableMap()

Gets the right tableMap for this join

Return Value

TableMap The table map

at line 76
public setPreviousJoin(ModelJoin $join)

Parameters

ModelJoin $join

at line 83
public getPreviousJoin()

at line 88
public isPrimary()

at line 93
public setRelationAlias($relationAlias)

Parameters

$relationAlias

at line 98
public getRelationAlias()

at line 103
public hasRelationAlias()

at line 119
public Object getObjectToRelate(Object $startObject)

This method returns the last related, but already hydrated object up until this join Starting from $startObject and continuously calling the getters to get to the base object for the current join.

This method only works if PreviousJoin has been defined,
which only happens when you provide dotted relations when calling join

Parameters

Object $startObject the start object all joins originate from and which has already hydrated

Return Value

Object the base Object of this join