Khandaker Toihidul Islam
Software Engineer
Backend : PHP | Mysql | Symfony | CakePhp | Wordpress | Drupal
Frontend : Node js | Vue js | React Js | Javascript | HTML | CSS | Bootstrap
Tools , Server : Nginx | Apache | Git | Jenkins | Jira | Asana | Silenium | Spira

ROLES in QueryBuilder Symfony 4

    public function userSelectBox(UserRepository $u): QueryBuilder
    {
    	$role = 'ROLE_SCHOOL';
          return $u->createQueryBuilder('u')
		        ->where('u.roles LIKE :roles')
		        ->setParameter('roles', '%"'.$role.'"%')
	            ->andWhere('u.active = :active')
	            ->setParameter('active', 1)		        
             	->orderBy('u.id', 'DESC');
     }

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *