fix(db): TooManyArguments: Too many arguments for method Doctrine\DBAL\Statement::executeQuery()

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2024-07-01 17:50:12 +02:00
parent 4bbaae5798
commit 2b83016a2b
No known key found for this signature in database
GPG key ID: 74434EFE0D2E2205

View file

@ -66,7 +66,17 @@ class PreparedStatement implements IPreparedStatement {
}
public function execute($params = null): IResult {
return ($this->result = new ResultAdapter($this->statement->executeQuery($params)));
if ($params !== null) {
foreach ($params as $key => $param) {
if (is_int($key)) {
// Parameter count starts with 1
$this->bindValue($key + 1, $param);
} else {
$this->bindValue($key, $param);
}
}
}
return ($this->result = new ResultAdapter($this->statement->executeQuery()));
}
public function rowCount(): int {