xPDOQuery.rightJoin
Last updated Oct 17th, 2026 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn morexPDOQuery::rightJoin¶
Adds a RIGHT JOIN clause to the query. Rows of the right table are kept even when the left table has no match.
Syntax¶
xPDOQuery rightJoin ( $class, [ $alias = ''], [ $conditions = array ()], [ $conjunction = xPDOQuery::SQL_AND], [ $binding = null], [ $condGroup = 0])
Example¶
Grab all Owners, including those without a Box.
$query = $xpdo->newQuery('Owner');
$query->rightJoin('Box','Box');
$owners = $xpdo->getCollection('Owner',$query);
When $conditions is omitted, xPDO builds the join condition from the foreign key definition between the main class and the joined class.
See Also¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










