Archived
1
0
Fork 0

app/models/Data/User.php: adding getSocialLinks()

This commit is contained in:
Henrik Hautakoski 2018-06-10 10:01:59 +02:00
parent ddf18fedb9
commit 4c100d23b3

View file

@ -247,6 +247,17 @@ class User extends Model
return $this;
}
public function getSocialLinks()
{
$providers = [
'github' => $this->getGithubId(),
'gitlab' => $this->getGitlabId(),
'google' => $this->getGoogleId()
];
return array_filter($providers);
}
static public function createFromOAuthData(UserDataInterface $data)
{
$oauth_id = 'set' . $data->getProvider() . 'Id';