'how i select some value equal array in Doctrine "createQueryBuilder"
can you help me with this code There are several columns in the database, one of which is a role, user role value looks like this: ["ROLE_ADMIN"] how can I get all users who have this role?
public function findUserWithRolle(){
$qb=$this->createQueryBuilder('R');
$qb->select('R.username')
->where('R.roles=["ROLE_ADMIN"]');
return $qb->getQuery()->getResult();
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
