Created
January 29, 2019 15:43
-
-
Save lkacenja/032b8efffe26e9485cbbf33fc5ba04d3 to your computer and use it in GitHub Desktop.
Look up a user by email and print out their social log in provider name.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$email = '<email>'; | |
$query = \Drupal::service('database')->select('users_field_data', 'users'); | |
$query->join('oneall_social_login_authmap', 'map', 'users.uid=map.uid'); | |
$query->join('oneall_social_login_identities', 'identity', 'identity.aid=map.aid'); | |
$query->addField('identity', 'provider_name', 'provider_name'); | |
$query->condition('users.mail', $email); | |
$result = $query->execute()->fetchAll(); | |
array_walk($result, 'print_r'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment