Reputation: 3401
The first thing that I do is to search all the users, and I successfully show all the users. Now I'm trying to query the roles of users, but it displays an array, like the image
Do you have an idea on how to query this in symfony? or Is this allowed in symfony to query an array? I have no idea on how to do it. I try to search it to google but no result found. I'm just stuck on this query
$query = $this->createQueryBuilder('u')
->where('u.role = :parameter')
->setParameter('parameter', 'ROLE_ADMIN')
->getQuery();
return $query->getResult();
Upvotes: 1
Views: 171
Reputation: 1123
Replace = by like :
->where('u.role like :parameter')
->setParameter('parameter', '%ROLE_ADMIN%')
Upvotes: 1