Przeglądaj źródła

Allow casting query functions as well

Signed-off-by: Joas Schilling <coding@schilljs.com>
tags/v23.0.0beta1
Joas Schilling 2 lat temu
rodzic
commit
aae16c21e6
No account linked to committer's email address

+ 2
- 2
lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php Wyświetl plik

@@ -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)
);

+ 2
- 2
lib/private/DB/QueryBuilder/ExpressionBuilder/OCIExpressionBuilder.php Wyświetl plik

@@ -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 . ')');

+ 1
- 1
lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php Wyświetl plik

@@ -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
*/

+ 2
- 2
lib/public/DB/QueryBuilder/IExpressionBuilder.php Wyświetl plik

@@ -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;
}

Ładowanie…
Anuluj
Zapisz