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.
 /**
  * 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;
 }
Beispiel #2
0
 /**
  * Creates and adds a right join to the query.
  *
  * @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 self
  */
 public function rightJoin($fromAlias, $join, $alias, $condition = null)
 {
     $this->qb->rightJoin($fromAlias, $join, $alias, $condition);
     return $this;
 }
Beispiel #3
0
 /**
  * Creates and adds a right join to the query.
  *
  * @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 QueryBuilder This QueryBuilder instance.
  */
 public function rightJoin(string $fromAlias, string $join, string $alias, string $condition = null) : QueryBuilder
 {
     $this->concreteQueryBuilder->rightJoin($this->quoteIdentifier($fromAlias), $this->quoteIdentifier($join), $this->quoteIdentifier($alias), $condition);
     return $this;
 }
Beispiel #4
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->helper->quoteColumnName($join), $alias, $condition);
     return $this;
 }
 /**
  * @test
  */
 public function rightJoinQuotesIdentifiersAndDelegatesToConcreteQueryBuilder()
 {
     $this->connection->quoteIdentifier('fromAlias')->shouldBeCalled()->willReturnArgument(0);
     $this->connection->quoteIdentifier('join')->shouldBeCalled()->willReturnArgument(0);
     $this->connection->quoteIdentifier('alias')->shouldBeCalled()->willReturnArgument(0);
     $this->concreteQueryBuilder->rightJoin('fromAlias', 'join', 'alias', null)->shouldBeCalled()->willReturn($this->subject);
     $this->subject->rightJoin('fromAlias', 'join', 'alias');
 }