app/models/Data/User.php: adding getSocialLinks()
This commit is contained in:
parent
ddf18fedb9
commit
4c100d23b3
1 changed files with 11 additions and 0 deletions
|
|
@ -247,6 +247,17 @@ class User extends Model
|
||||||
return $this;
|
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)
|
static public function createFromOAuthData(UserDataInterface $data)
|
||||||
{
|
{
|
||||||
$oauth_id = 'set' . $data->getProvider() . 'Id';
|
$oauth_id = 'set' . $data->getProvider() . 'Id';
|
||||||
|
|
|
||||||
Reference in a new issue