diff --git a/lib/Tools/Db/ExtendedQueryBuilder.php b/lib/Tools/Db/ExtendedQueryBuilder.php index 3911bd08..e7c955fb 100644 --- a/lib/Tools/Db/ExtendedQueryBuilder.php +++ b/lib/Tools/Db/ExtendedQueryBuilder.php @@ -44,6 +44,7 @@ use OCA\FilesLock\Tools\Traits\TArrayTools; use OCP\DB\QueryBuilder\ICompositeExpression; use OCP\DB\QueryBuilder\IQueryBuilder; +use OCP\DB\QueryBuilder\IQueryFunction; use OCP\IDBConnection; use OCP\ILogger; use Psr\Log\LoggerInterface; @@ -271,7 +272,7 @@ public function exprFieldWithinJsonFormat( $func->concat($fieldRight, $qb->createNamedParameter('"%')) ); - return $expr->iLike($alias . '.' . $field, $concat); + return (string)$expr->iLike($alias . '.' . $field, $concat); } @@ -303,7 +304,7 @@ public function exprValueWithinJsonFormat( $comp = 'notLike'; } - return $expr->$comp($field, $qb->createNamedParameter('%"' . $value . '"%')); + return (string)$expr->$comp($field, $qb->createNamedParameter('%"' . $value . '"%')); } @@ -428,9 +429,9 @@ public function exprLike(string $field, string $value, string $alias = '', bool $expr = $this->expr(); if ($cs) { - return $expr->like($field, $this->createNamedParameter($value)); + return (string)$expr->like($field, $this->createNamedParameter($value)); } else { - return $expr->iLike($field, $this->createNamedParameter($value)); + return (string)$expr->iLike($field, $this->createNamedParameter($value)); } } @@ -450,11 +451,11 @@ public function exprLimit(string $field, string $value, string $alias = '', bool $expr = $this->expr(); if ($cs) { - return $expr->eq($field, $this->createNamedParameter($value)); + return (string)$expr->eq($field, $this->createNamedParameter($value)); } else { $func = $this->func(); - return $expr->eq($func->lower($field), $func->lower($this->createNamedParameter($value))); + return (string)$expr->eq($func->lower($field), $func->lower($this->createNamedParameter($value))); } } @@ -473,7 +474,7 @@ public function exprLimitInt(string $field, int $value, string $alias = ''): str $expr = $this->expr(); - return $expr->eq($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT)); + return (string)$expr->eq($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT)); } @@ -592,7 +593,7 @@ public function exprLimitInArray(string $field, array $values, string $alias = ' $expr = $this->expr(); - return $expr->in($field, $this->createNamedParameter($values, IQueryBuilder::PARAM_STR_ARRAY)); + return (string)$expr->in($field, $this->createNamedParameter($values, IQueryBuilder::PARAM_STR_ARRAY)); } @@ -610,7 +611,7 @@ public function exprLimitBitwise(string $field, int $flag, string $alias = ''): $expr = $this->expr(); - return $expr->gt( + return (string)$expr->gt( $expr->bitwiseAnd($field, $flag), $this->createNamedParameter(0, IQueryBuilder::PARAM_INT) ); @@ -633,9 +634,9 @@ public function exprLt(string $field, int $value, bool $lte = false, string $ali $expr = $this->expr(); if ($lte) { - return $expr->lte($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT)); + return (string)$expr->lte($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT)); } else { - return $expr->lt($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT)); + return (string)$expr->lt($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT)); } } @@ -655,9 +656,9 @@ public function exprGt(string $field, int $value, bool $gte = false, string $ali $expr = $this->expr(); if ($gte) { - return $expr->gte($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT)); + return (string)$expr->gte($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT)); } else { - return $expr->gt($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT)); + return (string)$expr->gt($field, $this->createNamedParameter($value, IQueryBuilder::PARAM_INT)); } } @@ -763,11 +764,11 @@ public function exprUnlike(string $field, string $value, string $alias = '', boo $expr = $this->expr(); if ($cs) { - return $expr->notLike($field, $this->createNamedParameter($value)); + return (string)$expr->notLike($field, $this->createNamedParameter($value)); } else { $func = $this->func(); - return $expr->notLike($func->lower($field), $func->lower($this->createNamedParameter($value))); + return (string)$expr->notLike($func->lower($field), $func->lower($this->createNamedParameter($value))); } }