Skip to content

Commit 3eace16

Browse files
hanishsingladerrabus
authored andcommitted
Allow (Array)ParameterType in QueryBuilder
1 parent bc5efd4 commit 3eace16

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/QueryBuilder.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
use Doctrine\Common\Collections\ArrayCollection;
88
use Doctrine\Common\Collections\Criteria;
9+
use Doctrine\DBAL\ArrayParameterType;
10+
use Doctrine\DBAL\ParameterType;
911
use Doctrine\ORM\Internal\QueryType;
1012
use Doctrine\ORM\Query\Expr;
1113
use Doctrine\ORM\Query\Parameter;
@@ -428,12 +430,12 @@ public function getRootEntities(): array
428430
* ->setParameter('user_id', 1);
429431
* </code>
430432
*
431-
* @param string|int $key The parameter position or name.
432-
* @param string|int|null $type ParameterType::* or \Doctrine\DBAL\Types\Type::* constant
433+
* @param string|int $key The parameter position or name.
434+
* @param ParameterType|ArrayParameterType|string|int|null $type ParameterType::*, ArrayParameterType::* or \Doctrine\DBAL\Types\Type::* constant
433435
*
434436
* @return $this
435437
*/
436-
public function setParameter(string|int $key, mixed $value, string|int|null $type = null): static
438+
public function setParameter(string|int $key, mixed $value, ParameterType|ArrayParameterType|string|int|null $type = null): static
437439
{
438440
$existingParameter = $this->getParameter($key);
439441

0 commit comments

Comments
 (0)