replace this line with $user = $em->getRepository('Seeder\FrontendBundle\Entity\User')->findOneBy(array('userFacebookId' => $user_profile['id']));