On a Symfony 6.0.8 project using Doctrine 2.7.0, I've added some Enums as field types for my entities (I followed this tutorial: https://smaine-milianni.medium.com/use-php-enums-as-doctrine-type-in-symfony-85909aa0a19a) and everything works fine.
What bugs me is that in my repositories, I can filter by these fields with this
$qb = $this->createQueryBuilder('e');
$query = $qb->select("e")
->where('e.status = :status')
->setParameter('status', Status::STATUS_ACCEPTED)
;
return $query->getQuery()->getResult();
but not this
$criterias = array(
"status" => Status::STATUS_ACCEPTED,
);
$repository->findBy($criterias);
Adding ->value didn't help either. As soon as I try to filter with Enums, it returns an empty set.
Is there something I'm missing?