/**
  * @param $token
  * @return Response
  */
 public function getInfoAction($token)
 {
     $linkedinUser = LinkedinUser::getUserByToken($token);
     $user = new User();
     $user->setEmail($linkedinUser->getEmail());
     $user->setName($linkedinUser->getFirstName() . ' ' . $linkedinUser->getLastName());
     $user->setLinkedinUser($linkedinUser);
     /** @var EntityManager $entityManager */
     $entityManager = $this->get('neo4j.manager');
     $entityManager->persist($linkedinUser);
     $entityManager->persist($user);
     $entityManager->flush();
     return new Response('');
 }
Esempio n. 2
0
 /**
  * Create user from FacebookUser
  *
  * @param LinkedinUser $linkedinUser
  * @return User
  */
 public function createFromLinkedinUser(LinkedinUser $linkedinUser)
 {
     $user = new User();
     $user->setLinkedinUser($linkedinUser, true);
     return $user;
 }