1 | <?php namespace League\OAuth2\Client\Provider; |
||
9 | class LinkedInResourceOwner extends GenericResourceOwner |
||
10 | { |
||
11 | |||
12 | use ArrayAccessorTrait; |
||
13 | |||
14 | /** |
||
15 | * Raw response |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $response = []; |
||
20 | |||
21 | /** |
||
22 | * Sorted profile pictures |
||
23 | * |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $sortedProfilePictures = []; |
||
27 | |||
28 | /** |
||
29 | * @var string|null |
||
30 | */ |
||
31 | private $email; |
||
32 | |||
33 | /** |
||
34 | * Creates new resource owner. |
||
35 | * |
||
36 | * @param array $response |
||
37 | * @param string|null $email |
||
38 | */ |
||
39 | 3 | public function __construct(array $response = array(), $email = null) |
|
45 | |||
46 | /** |
||
47 | * Gets resource owner attribute by key. The key supports dot notation. |
||
48 | * |
||
49 | * @return mixed |
||
50 | */ |
||
51 | 3 | public function getAttribute($key) |
|
55 | |||
56 | /** |
||
57 | * Get user first name |
||
58 | * |
||
59 | * @return string|null |
||
60 | */ |
||
61 | 3 | public function getFirstName() |
|
65 | |||
66 | /** |
||
67 | * Get user user id |
||
68 | * |
||
69 | * @return string|null |
||
70 | */ |
||
71 | 3 | public function getId() |
|
75 | |||
76 | /** |
||
77 | * Get specific image by size |
||
78 | * |
||
79 | * @param integer $size |
||
80 | * @return array|null |
||
81 | */ |
||
82 | 1 | public function getImageBySize($size) |
|
90 | |||
91 | /** |
||
92 | * Get available user image sizes |
||
93 | * |
||
94 | * @return array |
||
95 | */ |
||
96 | 1 | public function getImageSizes() |
|
102 | |||
103 | /** |
||
104 | * Get user image url |
||
105 | * |
||
106 | * @return string|null |
||
107 | */ |
||
108 | 3 | public function getImageUrl() |
|
115 | |||
116 | /** |
||
117 | * Get user last name |
||
118 | * |
||
119 | * @return string|null |
||
120 | */ |
||
121 | 3 | public function getLastName() |
|
125 | |||
126 | /** |
||
127 | * Returns the sorted collection of profile pictures. |
||
128 | * |
||
129 | * @return array |
||
130 | */ |
||
131 | 3 | public function getSortedProfilePictures() |
|
135 | |||
136 | /** |
||
137 | * Get user url |
||
138 | * |
||
139 | * @return string|null |
||
140 | */ |
||
141 | 3 | public function getUrl() |
|
147 | |||
148 | /** |
||
149 | * Get user email, if available |
||
150 | * |
||
151 | * @return string|null |
||
152 | */ |
||
153 | 2 | public function getEmail() |
|
157 | |||
158 | /** |
||
159 | * Attempts to sort the collection of profile pictures included in the profile |
||
160 | * before caching them in the resource owner instance. |
||
161 | * |
||
162 | * @return void |
||
163 | */ |
||
164 | 3 | private function setSortedProfilePictures() |
|
199 | |||
200 | /** |
||
201 | * Return all of the owner details available as an array. |
||
202 | * |
||
203 | * @return array |
||
204 | */ |
||
205 | 2 | public function toArray() |
|
209 | } |
||
210 |