/** * Returns the column name quoted and with table alias prefix as needed by the implementation * * @param string $column * @param string $tableAlias * @return string */ public function getColumnName($column, $tableAlias = '') { if ($tableAlias !== '') { $tableAlias .= '.'; } return $this->helper->quoteColumnName($tableAlias . $column); }
/** * @param string $table * @return string */ private function getTableName($table) { if ($this->automaticTablePrefix === false || strpos($table, '*PREFIX*') === 0) { return $this->helper->quoteColumnName($table); } return $this->helper->quoteColumnName('*PREFIX*' . $table); }
/** * @dataProvider dataQuoteColumnNames * @param mixed $input * @param string $expected */ public function testQuoteColumnNames($input, $expected) { $this->assertSame($expected, $this->helper->quoteColumnNames($input)); }
/** * 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); }
/** * Adds an ordering to the query results. * * @param string $sort The ordering expression. * @param string $order The ordering direction. * * @return \OCP\DB\QueryBuilder\IQueryBuilder This QueryBuilder instance. */ public function addOrderBy($sort, $order = null) { $this->queryBuilder->addOrderBy($this->helper->quoteColumnName($sort), $order); return $this; }
/** * Returns a IQueryFunction that casts the column to the given type * * @param string $column * @param mixed $type One of IQueryBuilder::PARAM_* * @return string */ public function castColumn($column, $type) { return new QueryFunction($this->helper->quoteColumnName($column)); }