class Join
Data object to describe a join between two tables, for example <pre> table_a LEFT JOIN table_b ON table_a.id = table_b.a_id </pre>
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 |
||
addCondition(string $left, string $right, string $operator = self::EQUAL)
Join condition definition. |
||
addConditions(array $lefts, array $rights, array $operators = array())
Join condition definition, for several conditions |
||
addExplicitCondition(string $leftTableName, string $leftColumnName, string $leftTableAlias = null, string $rightTableName = null, string $rightColumnName = null, string $rightTableAlias = null, string $operator = self::EQUAL)
Join condition definition. |
||
integer |
countConditions()
Retrieve the number of conditions in the join |
|
array |
getConditions()
Return an array of the join conditions |
|
addOperator(string $operator = null) | ||
string[] | getOperator($index) | |
getOperators() | ||
setJoinType(string $joinType = null)
Set the join type |
||
string |
getJoinType()
Get the join type |
|
addLeftColumnName(string $left)
Add a left column name to the join condition |
||
string |
getLeftColumn(integer $index)
Get the fully qualified name of the left column of the join condition |
|
string |
getLeftColumnName(integer $index)
Get the left column name of the join condition |
|
array |
getLeftColumns()
Get the list of all the names of left columns of the join condition |
|
setLeftTableName($leftTableName) | ||
getLeftTableName() | ||
setLeftTableAlias($leftTableAlias) | ||
getLeftTableAlias() | ||
hasLeftTableAlias() | ||
getLeftTableAliasOrName() | ||
getLeftTableWithAlias() | ||
addRightColumnName(string $right)
Add a right column name to the join condition |
||
string |
getRightColumn(integer $index)
Get the fully qualified name of the right column of the join condition |
|
string |
getRightColumnName(integer $index)
Get the right column name of the join condition |
|
all | getRightColumns() | |
setRightTableName($rightTableName) | ||
getRightTableName() | ||
setRightTableAlias($rightTableAlias) | ||
getRightTableAlias() | ||
hasRightTableAlias() | ||
getRightTableAliasOrName() | ||
getRightTableWithAlias() | ||
AdapterInterface |
getAdapter()
Get the adapter. |
|
void |
setAdapter(AdapterInterface $db)
Set the adapter. |
|
setJoinCondition(AbstractCriterion $joinCondition)
Set a custom join condition |
||
AbstractCriterion |
getJoinCondition()
Get the custom join condition, if previously set |
|
buildJoinCondition(Criteria $c)
Set the custom join condition Criterion based on the conditions of this join |
||
string |
getClause(array $params)
Get the join clause for this Join. |
|
equals($join) | ||
string |
toString()
Returns a string representation of the class, |
|
__toString() |
Details
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
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.
at line 131
public
addConditions(array $lefts, array $rights, array $operators = array())
Join condition definition, for several conditions
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.
at line 178
public integer
countConditions()
Retrieve the number of conditions in the join
at line 188
public array
getConditions()
Return an array of the join conditions
at line 205
public
addOperator(string $operator = null)
at line 213
public string[]
getOperator($index)
at line 218
public
getOperators()
at line 230
public
setJoinType(string $joinType = null)
Set the join type
at line 241
public string
getJoinType()
Get the join type
at line 256
public
addLeftColumnName(string $left)
Add a left column name to the join condition
at line 272
public string
getLeftColumn(integer $index)
Get the fully qualified name of the left column of the join condition
at line 290
public string
getLeftColumnName(integer $index)
Get the left column name of the join condition
at line 299
public array
getLeftColumns()
Get the list of all the names of left columns of the join condition
at line 309
public
setLeftTableName($leftTableName)
at line 316
public
getLeftTableName()
at line 321
public
setLeftTableAlias($leftTableAlias)
at line 328
public
getLeftTableAlias()
at line 333
public
hasLeftTableAlias()
at line 338
public
getLeftTableAliasOrName()
at line 343
public
getLeftTableWithAlias()
at line 358
public
addRightColumnName(string $right)
Add a right column name to the join condition
at line 374
public string
getRightColumn(integer $index)
Get the fully qualified name of the right column of the join condition
at line 392
public string
getRightColumnName(integer $index)
Get the right column name of the join condition
at line 400
public all
getRightColumns()
at line 410
public
setRightTableName($rightTableName)
at line 417
public
getRightTableName()
at line 422
public
setRightTableAlias($rightTableAlias)
at line 429
public
getRightTableAlias()
at line 434
public
hasRightTableAlias()
at line 439
public
getRightTableAliasOrName()
at line 444
public
getRightTableWithAlias()
at line 456
public AdapterInterface
getAdapter()
Get the adapter.
The AdapterInterface which might be used to get db specific
variations of sql.
at line 468
public void
setAdapter(AdapterInterface $db)
Set the adapter.
The AdapterInterface might be used to get db specific variations of sql.
at line 478
public
setJoinCondition(AbstractCriterion $joinCondition)
Set a custom join condition
at line 488
public AbstractCriterion
getJoinCondition()
Get the custom join condition, if previously set
at line 498
public
buildJoinCondition(Criteria $c)
Set the custom join condition Criterion based on the conditions of this 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.
at line 555
public
equals($join)
at line 569
public string
toString()
Returns a string representation of the class,