Skip to content

Commit

Permalink
Merge pull request #63 from hoyama/modify
Browse files Browse the repository at this point in the history
Support comma-separated list of IDs in getChannelbyId
  • Loading branch information
alaouy authored May 11, 2017
2 parents 877eb94 + 27d611e commit f6abd68
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Alaouy/Youtube/Youtube.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,18 @@ public function getChannelById($id, $optionalParams = false, $part = ['id', 'sni
{
$API_URL = $this->getApi('channels.list');
$params = array(
'id' => $id,
'id' => is_array($id) ? implode(',', $id) : $id,
'part' => implode(', ', $part),
);
if ($optionalParams) {
$params = array_merge($params, $optionalParams);
}
$apiData = $this->api_get($API_URL, $params);

if (is_array($id)) {
return $this->decodeMultiple($apiData);
}

return $this->decodeSingle($apiData);
}

Expand Down

0 comments on commit f6abd68

Please sign in to comment.