Example #1
0
 /**
  * Creates a NOT IN () comparison expression with the given arguments.
  *
  * @param string $x The field in string format to be inspected by NOT IN() comparison.
  * @param string|array $y The placeholder or the array of values to be used by NOT IN() comparison.
  *
  * @return string
  */
 public function notIn($x, $y)
 {
     $x = $this->helper->quoteColumnName($x);
     $y = $this->helper->quoteColumnNames($y);
     return $this->expressionBuilder->notIn($x, $y);
 }
Example #2
0
 /**
  * @dataProvider dataQuoteColumnNames
  * @param mixed $input
  * @param string $expected
  */
 public function testQuoteColumnNames($input, $expected)
 {
     $this->assertSame($expected, $this->helper->quoteColumnNames($input));
 }
Example #3
0
 /**
  * Adds a grouping expression to the query.
  *
  * <code>
  *     $qb = $conn->getQueryBuilder()
  *         ->select('u.name')
  *         ->from('users', 'u')
  *         ->groupBy('u.lastLogin');
  *         ->addGroupBy('u.createdAt')
  * </code>
  *
  * @param mixed $groupBy The grouping expression.
  *
  * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance.
  */
 public function addGroupBy($groupBy)
 {
     $groupBys = is_array($groupBy) ? $groupBy : func_get_args();
     call_user_func_array([$this->queryBuilder, 'addGroupBy'], $this->helper->quoteColumnNames($groupBys));
     return $this;
 }