1 | <?php |
||
10 | class LinkedInController extends Controller |
||
11 | { |
||
12 | const LINKEDIN_API = 'https://api.linkedin.com/v1'; |
||
13 | |||
14 | /** |
||
15 | * LinkedIn API base Url |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $baseUrl; |
||
19 | |||
20 | /** |
||
21 | * Instance of Client |
||
22 | * @var object |
||
23 | */ |
||
24 | protected $client; |
||
25 | |||
26 | /** |
||
27 | * Response from requests made to LinkedIn |
||
28 | * @var mixed |
||
29 | */ |
||
30 | protected $response; |
||
31 | |||
32 | /** |
||
33 | * Initialize the Controller with necessary arguments |
||
34 | */ |
||
35 | public function __construct() |
||
40 | |||
41 | /** |
||
42 | * Set options for making the Client request |
||
43 | * @return void |
||
44 | */ |
||
45 | private function setRequestOptions() |
||
55 | |||
56 | /** |
||
57 | * Get the response from New York times API |
||
58 | * @param string $relativeUrl |
||
59 | */ |
||
60 | private function setGetResponse($relativeUrl) |
||
64 | |||
65 | /** |
||
66 | * Get the whole response from a get operation |
||
67 | * @return array |
||
68 | */ |
||
69 | private function getResponse() |
||
73 | |||
74 | /** |
||
75 | * Get the data response from a get operation |
||
76 | * @return array |
||
77 | */ |
||
78 | private function getData() |
||
82 | |||
83 | /** |
||
84 | * Return all data to the LinkedIn API dashboard |
||
85 | * @return mixed |
||
86 | */ |
||
87 | public function getPage() |
||
107 | } |
||
108 | |||
109 |