Skip to content

Commit

Permalink
Merge pull request #60 from Hackwar/patch-1
Browse files Browse the repository at this point in the history
Allow optional parameters for activities call
  • Loading branch information
madcoda authored May 4, 2017
2 parents 886e3aa + 443a10b commit 78ceca5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Youtube.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ public function getPlaylistItemsByPlaylistIdAdvanced($params, $pageInfo = false)
* @return array
* @throws \Exception
*/
public function getActivitiesByChannelId($channelId)
public function getActivitiesByChannelId($channelId, $optionalParams = false)
{
if (empty($channelId)) {
throw new \InvalidArgumentException('ChannelId must be supplied');
Expand All @@ -452,6 +452,9 @@ public function getActivitiesByChannelId($channelId)
'channelId' => $channelId,
'part' => 'id, snippet, contentDetails'
);
if ($optionalParams) {
$params = array_merge($params, $optionalParams);
}
$apiData = $this->api_get($API_URL, $params);
return $this->decodeList($apiData);
}
Expand Down

0 comments on commit 78ceca5

Please sign in to comment.