This method could be used in two forms:
leftJoin( 't2', $joinCondition )
Takes 2 string arguments and returns \eZ\Publish\Core\Persistence\Database\SelectQuery.
The first parameter is the name of the table to join with. The table to
which is joined should have been previously set with the from() method.
The second parameter should be a string containing a join condition that
is returned by an \eZ\Publish\Core\Persistence\Database\SelectQueryExpression.
Example:
the following code will produce the SQL
SELECT id FROM t1 LEFT JOIN t2 ON t1.id = t2.id
$q->select( 'id' )->from( 't1' )->leftJoin( 't2', $q->expr->eq('t1.id', 't2.id' ) );
leftJoin( 't2', 't1.id', 't2.id' )
Takes 3 string arguments and returns \eZ\Publish\Core\Persistence\Database\SelectQuery. This is a simplified form
of the 2 parameter version. leftJoin( 't2', 't1.id', 't2.id' ) is
equal to leftJoin( 't2', $this->expr->eq('t1.id', 't2.id' ) );
The first parameter is the name of the table to join with. The table to
which is joined should have been previously set with the from() method.
The second parameter is the name of the column on the table set
previously with the from() method and the third parameter the name of
the column to join with on the table that was specified in the first
parameter.
Example:
the following code will produce the SQL
SELECT id FROM t1 LEFT JOIN t2 ON t1.id = t2.id
$q->select( 'id' )->from( 't1' )->leftJoin( 't2', 't1.id', 't2.id' );
public leftJoin ( ) : eZ\Publish\Core\Persistence\Database\SelectQuery | ||
Résultat | eZ\Publish\Core\Persistence\Database\SelectQuery |