xPDOQuery.leftJoin
Last updated not available | Page history | Improve this page | Report an issue
xPDOQuery::leftJoin¶
Adds a LEFT JOIN clause to the query.
Syntax¶
API Docs: xPDOQuery::leftJoin()
void leftJoin ( $class, [ $alias = ''], [ $conditions = array ()], [ $conjunction = xPDOQuery::SQL_AND], [ $binding = null], [ $condGroup = 0])
Example¶
Select all Boxes and the Owner name.
$query = $xpdo->newQuery('Box');
$query->select($xpdo->getSelectColumns('Box'));
$query->select(array(
'Owner.name'
));
$query->leftJoin('Owner','Owner');
$boxes = $xpdo->getCollection('Box',$query);