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 | */ |
||
38 | 3 | public function __construct(array $response = array()) |
|
43 | |||
44 | /** |
||
45 | * Gets resource owner attribute by key. The key supports dot notation. |
||
46 | * |
||
47 | * @return mixed |
||
48 | */ |
||
49 | 3 | public function getAttribute($key) |
|
53 | |||
54 | /** |
||
55 | * Get user first name |
||
56 | * |
||
57 | * @return string|null |
||
58 | */ |
||
59 | 3 | public function getFirstName() |
|
63 | |||
64 | /** |
||
65 | * Get user user id |
||
66 | * |
||
67 | * @return string|null |
||
68 | */ |
||
69 | 3 | public function getId() |
|
73 | |||
74 | /** |
||
75 | * Get specific image by size |
||
76 | * |
||
77 | * @param integer $size |
||
78 | * @return array|null |
||
79 | */ |
||
80 | 1 | public function getImageBySize($size) |
|
88 | |||
89 | /** |
||
90 | * Get available user image sizes |
||
91 | * |
||
92 | * @return array |
||
93 | */ |
||
94 | 1 | public function getImageSizes() |
|
100 | |||
101 | /** |
||
102 | * Get user image url |
||
103 | * |
||
104 | * @return string|null |
||
105 | */ |
||
106 | 3 | public function getImageUrl() |
|
113 | |||
114 | /** |
||
115 | * Get user last name |
||
116 | * |
||
117 | * @return string|null |
||
118 | */ |
||
119 | 3 | public function getLastName() |
|
123 | |||
124 | /** |
||
125 | * Returns the sorted collection of profile pictures. |
||
126 | * |
||
127 | * @return array |
||
128 | */ |
||
129 | 3 | public function getSortedProfilePictures() |
|
133 | |||
134 | /** |
||
135 | * Get user url |
||
136 | * |
||
137 | * @return string|null |
||
138 | */ |
||
139 | 3 | public function getUrl() |
|
145 | |||
146 | /** |
||
147 | * Get user email, if available |
||
148 | * |
||
149 | * @return string|null |
||
150 | */ |
||
151 | 2 | public function getEmail() |
|
155 | |||
156 | /** |
||
157 | * Attempts to sort the collection of profile pictures included in the profile |
||
158 | * before caching them in the resource owner instance. |
||
159 | * |
||
160 | * @return void |
||
161 | */ |
||
162 | 3 | private function setSortedProfilePictures() |
|
197 | |||
198 | /** |
||
199 | * Return all of the owner details available as an array. |
||
200 | * |
||
201 | * @return array |
||
202 | */ |
||
203 | 2 | public function toArray() |
|
207 | } |
||
208 |