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(); } }