Jump to main content Jump to doc navigation

xPDOQuery.innerJoin

Other versions: 3.x — Found a problem? Please edit this page or report an issue.

xPDOQuery::innerJoin

Add an INNER JOIN clause to the query.

Syntax

API Docs: http://api.modx.com/revolution/2.2/db_core_xpdo_om_xpdoquery.class.html#\xPDOQuery::innerJoin()

void innerJoin ( $class, [ $alias = ''], [ $conditions = array ()], [ $conjunction = xPDOQuery::SQL_AND], [ $binding = null], [ $condGroup = 0])

Example

Grab only Boxes with an Owner named Mark.

$query = $xpdo->newQuery('Box');
$query->innerJoin('Owner','Owner');
$query->where(array(
   'Owner.name' => 'Mark',
));
$boxes = $xpdo->getCollection('Box',$query);

See Also