setPassword($newEncodedPassword); $this->_em->persist($user); $this->_em->flush(); } public function findByRole($role) { return $this->createQueryBuilder('u') ->andWhere('u.roles LIKE :role') ->setParameter('role', '%'.$role.'%') ->getQuery() ->getResult(); } // /** // * @return User[] Returns an array of User objects // */ /* public function findByExampleField($value) { return $this->createQueryBuilder('u') ->andWhere('u.exampleField = :val') ->setParameter('val', $value) ->orderBy('u.id', 'ASC') ->setMaxResults(10) ->getQuery() ->getResult() ; } */ /* public function findOneBySomeField($value): ?User { return $this->createQueryBuilder('u') ->andWhere('u.exampleField = :val') ->setParameter('val', $value) ->getQuery() ->getOneOrNullResult() ; } */ }