adding app/library/OAuth/UserData/LinkedIn.php
This commit is contained in:
parent
6312f5d22e
commit
cd694ebbca
1 changed files with 63 additions and 0 deletions
63
app/library/OAuth/UserData/LinkedIn.php
Normal file
63
app/library/OAuth/UserData/LinkedIn.php
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
<?php
|
||||
|
||||
namespace Httpcb\OAuth\UserData;
|
||||
|
||||
class LinkedIn implements UserDataInterface
|
||||
{
|
||||
protected $data;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function __construct(array $data)
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getProvider()
|
||||
{
|
||||
return 'LinkedIn';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->data['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
$name = '';
|
||||
if (isset($this->data['firstName'])) {
|
||||
$name = $this->data['firstName'];
|
||||
}
|
||||
if (isset($this->data['lastName'])) {
|
||||
$name .= ' ' . $this->data['lastName'];
|
||||
}
|
||||
return $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->data['emailAddress'];
|
||||
}
|
||||
}
|
||||
Reference in a new issue