-
Notifications
You must be signed in to change notification settings - Fork 36
/
Activities.php
52 lines (43 loc) · 1.05 KB
/
Activities.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
namespace GetStream\Stream;
class Activities extends Feed
{
/**
* @var string
*/
protected $token;
/**
* @param ClientInterface $client
* @param string $api_key
* @param string $token
*/
public function __construct(ClientInterface $client, $api_key, $token)
{
$this->client = $client;
$this->api_key = $api_key;
$this->token = $token;
}
/**
* @param string $resource
* @param string $action
*
* @return array
*/
protected function getHttpRequestHeaders($resource, $action)
{
$headers = parent::getHttpRequestHeaders($resource, $action);
$headers['Authorization'] = $this->token;
return $headers;
}
public function _getActivities($query_params, $enrich = false)
{
if (empty($query_params)) {
return;
}
$url = 'activities/';
if($enrich) {
$url = "enrich/$url";
}
return $this->makeHttpRequest($url, 'GET', null, $query_params);
}
}