]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow casting query functions as well 27852/head
authorJoas Schilling <coding@schilljs.com>
Wed, 7 Jul 2021 12:20:24 +0000 (14:20 +0200)
committerJoas Schilling <coding@schilljs.com>
Wed, 7 Jul 2021 12:20:24 +0000 (14:20 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php
lib/private/DB/QueryBuilder/ExpressionBuilder/OCIExpressionBuilder.php
lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php
lib/public/DB/QueryBuilder/IExpressionBuilder.php

index a837c1ad752ba026047412ac058baa14610afab2..c35afd0870b09ecdd1c6f9283c7ae6cddace290b 100644 (file)
@@ -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)
                );
index 2a13562d00a1214973c671aedaf4fce482463ab7..4cea234779e26fb7567bebe1e846720bdeb05acd 100644 (file)
@@ -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 . ')');
index 5df2f407411498a645dc7c03a06106f6e41b1e2d..4e0de5ef42b14d71836cef84e7d517eaec6ce819 100644 (file)
@@ -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
         */
index b3dbf564e3539bb0686d9053270ed3c93ab485bb..77701240d5174dd806b9a83e8744295d03ed8e91 100644 (file)
@@ -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;
 }