mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 08:44:07 -04:00
Allow casting query functions as well
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
11d21e5f5c
commit
aae16c21e6
4 changed files with 7 additions and 7 deletions
|
|
@ -425,11 +425,11 @@ class ExpressionBuilder implements IExpressionBuilder {
|
|||
/**
|
||||
* Returns a IQueryFunction that casts the column to the given type
|
||||
*
|
||||
* @param string $column
|
||||
* @param string|IQueryFunction $column
|
||||
* @param mixed $type One of IQueryBuilder::PARAM_*
|
||||
* @return IQueryFunction
|
||||
*/
|
||||
public function castColumn(string $column, $type): IQueryFunction {
|
||||
public function castColumn($column, $type): IQueryFunction {
|
||||
return new QueryFunction(
|
||||
$this->helper->quoteColumnName($column)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -161,11 +161,11 @@ class OCIExpressionBuilder extends ExpressionBuilder {
|
|||
/**
|
||||
* Returns a IQueryFunction that casts the column to the given type
|
||||
*
|
||||
* @param string $column
|
||||
* @param string|IQueryFunction $column
|
||||
* @param mixed $type One of IQueryBuilder::PARAM_*
|
||||
* @return IQueryFunction
|
||||
*/
|
||||
public function castColumn(string $column, $type): IQueryFunction {
|
||||
public function castColumn($column, $type): IQueryFunction {
|
||||
if ($type === IQueryBuilder::PARAM_STR) {
|
||||
$column = $this->helper->quoteColumnName($column);
|
||||
return new QueryFunction('to_char(' . $column . ')');
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class PgSqlExpressionBuilder extends ExpressionBuilder {
|
|||
/**
|
||||
* Returns a IQueryFunction that casts the column to the given type
|
||||
*
|
||||
* @param string $column
|
||||
* @param string|IQueryFunction $column
|
||||
* @param mixed $type One of IQueryBuilder::PARAM_*
|
||||
* @return IQueryFunction
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -431,7 +431,7 @@ interface IExpressionBuilder {
|
|||
/**
|
||||
* Returns a IQueryFunction that casts the column to the given type
|
||||
*
|
||||
* @param string $column
|
||||
* @param string|IQueryFunction $column
|
||||
* @param mixed $type One of IQueryBuilder::PARAM_*
|
||||
* @return IQueryFunction
|
||||
* @since 9.0.0
|
||||
|
|
@ -439,5 +439,5 @@ interface IExpressionBuilder {
|
|||
* @psalm-taint-sink sql $column
|
||||
* @psalm-taint-sink sql $type
|
||||
*/
|
||||
public function castColumn(string $column, $type): IQueryFunction;
|
||||
public function castColumn($column, $type): IQueryFunction;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue