Doctrine\DBAL\Query\QueryBuilder::rightJoin PHP Method

rightJoin() public method

$qb = $conn->createQueryBuilder() ->select('u.name') ->from('users', 'u') ->rightJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1');
public rightJoin ( string $fromAlias, string $join, string $alias, string $condition = null )
$fromAlias string The alias that points to a from clause.
$join string The table name to join.
$alias string The alias of the join table.
$condition string The condition for the join.
    public function rightJoin($fromAlias, $join, $alias, $condition = null)
    {
        return $this->add('join', array($fromAlias => array('joinType' => 'right', 'joinTable' => $join, 'joinAlias' => $alias, 'joinCondition' => $condition)), true);
    }

Usage Example

Esempio n. 1
0
 /**
  * Creates and adds a right join to the query.
  *
  * <code>
  *     $qb = $conn->getQueryBuilder()
  *         ->select('u.name')
  *         ->from('users', 'u')
  *         ->rightJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1');
  * </code>
  *
  * @param string $fromAlias The alias that points to a from clause.
  * @param string $join The table name to join.
  * @param string $alias The alias of the join table.
  * @param string $condition The condition for the join.
  *
  * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance.
  */
 public function rightJoin($fromAlias, $join, $alias, $condition = null)
 {
     $this->queryBuilder->rightJoin($fromAlias, $this->getTableName($join), $alias, $condition);
     return $this;
 }
All Usage Examples Of Doctrine\DBAL\Query\QueryBuilder::rightJoin