original_string: protected function createIdentity( User $user, UserResponseInterface $response )
      {
          $identity = new $this->userIdentityClass;
          $identity->setAccessToken( $this->getAccessToken( $response ));
          $identity->setIdentifier( $response->getUsername() );
          $identity->setType( $response->getResourceOwner()->getName() );
          $identity->setUser( $user );
          $identity->setName( $this->getRealName( $response ));
          $identity->setEmail( $this->getEmail( $response ));
          $this->om->persist( $identity );
          $this->om->flush();
          return $identity;
      }
code: protected function createIdentity( User $user, UserResponseInterface $response )
      {
          $identity = new $this->userIdentityClass;
          $identity->setAccessToken( $this->getAccessToken( $response ));
          $identity->setIdentifier( $response->getUsername() );
          $identity->setType( $response->getResourceOwner()->getName() );
          $identity->setUser( $user );
          $identity->setName( $this->getRealName( $response ));
          $identity->setEmail( $this->getEmail( $response ));
          $this->om->persist( $identity );
          $this->om->flush();
          return $identity;
      }
code_tokens: protected function createIdentity ( User $ user , UserResponseInterface $ response ) { $ identity = new $ this -> userIdentityClass ; $ identity -> setAccessToken ( $ this -> getAccessToken ( $ response ) ) ; $ identity -> setIdentifier ( $ response -> getUsername ( ) ) ; $ identity -> setType ( $ response -> getResourceOwner ( ) -> getName ( ) ) ; $ identity -> setUser ( $ user ) ; $ identity -> setName ( $ this -> getRealName ( $ response ) ) ; $ identity -> setEmail ( $ this -> getEmail ( $ response ) ) ; $ this -> om -> persist ( $ identity ) ; $ this -> om -> flush ( ) ; return $ identity ; }
docstring: Creates new Identity
  
  @param \HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface $response
  @param \Userfriendly\Bundle\SocialUserBundle\Model\User $user
  @return \Userfriendly\Bundle\SocialUserBundle\Model\UserIdentity
docstring_tokens: Creates new Identity