Skip to content

Instantly share code, notes, and snippets.

@vincenzodibiaggio
Last active December 19, 2015 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincenzodibiaggio/5920932 to your computer and use it in GitHub Desktop.
Save vincenzodibiaggio/5920932 to your computer and use it in GitHub Desktop.
FriendsOfSymfony/FOSTwitterBundle - Load existing user and connect to twitter account using twitter account data after authorization
<?php
# On documentation we can see:
public function findUserByTwitterId($twitterID)
{
return $this->userManager->findUserBy(array('twitterID' => $twitterID));
}
public function loadUserByUsername($username)
{
$user = $this->findUserByTwitterId($username);
# To permit association between logged user and authorized user on twitter I have changed code:
public function findUserByTwitterId($username)
{
return $this->userManager->findUserBy(array('twitter_username' => $username));
}
# because at this moment in the workflow we manage the twitter_username instead of twitter_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment