Fixed errors that query builder setParameters now expects an ArrayCollection instead of an array

This commit is contained in:
Jan Böhmer 2024-06-09 23:51:11 +02:00
parent 60325e797d
commit 78671b0bfe
2 changed files with 12 additions and 10 deletions

View file

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace App\Repository;
use App\Entity\UserSystem\User;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\NonUniqueResultException;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
@ -97,10 +98,10 @@ final class UserRepository extends NamedDBElementRepository implements PasswordU
->where('u.name = (:name)')
->orWhere('u.email = (:email)');
$qb->setParameters([
$qb->setParameters(new ArrayCollection([
'email' => $name_or_password,
'name' => $name_or_password,
]);
]));
try {
return $qb->getQuery()->getOneOrNullResult();