Skip to content

Commit 443a10b

Browse files
authored
Allow optional parameters for activities call
1 parent 886e3aa commit 443a10b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Youtube.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ public function getPlaylistItemsByPlaylistIdAdvanced($params, $pageInfo = false)
442442
* @return array
443443
* @throws \Exception
444444
*/
445-
public function getActivitiesByChannelId($channelId)
445+
public function getActivitiesByChannelId($channelId, $optionalParams = false)
446446
{
447447
if (empty($channelId)) {
448448
throw new \InvalidArgumentException('ChannelId must be supplied');
@@ -452,6 +452,9 @@ public function getActivitiesByChannelId($channelId)
452452
'channelId' => $channelId,
453453
'part' => 'id, snippet, contentDetails'
454454
);
455+
if ($optionalParams) {
456+
$params = array_merge($params, $optionalParams);
457+
}
455458
$apiData = $this->api_get($API_URL, $params);
456459
return $this->decodeList($apiData);
457460
}

0 commit comments

Comments
 (0)