Alaouy\Youtube\Youtube::getActivitiesByChannelId PHP Method

getActivitiesByChannelId() public method

public getActivitiesByChannelId ( $channelId, $part = ['id', 'snippet', 'contentDetails'], $maxResults = 5 ) : array
$channelId
return array
    public function getActivitiesByChannelId($channelId, $part = ['id', 'snippet', 'contentDetails'], $maxResults = 5)
    {
        if (empty($channelId)) {
            throw new \InvalidArgumentException('ChannelId must be supplied');
        }
        $API_URL = $this->getApi('activities');
        $params = array('channelId' => $channelId, 'part' => implode(', ', $part), 'maxResults' => $maxResults);
        $apiData = $this->api_get($API_URL, $params);
        return $this->decodeList($apiData);
    }

Usage Example

 /**
  *
  *
  * @expectedException  \InvalidArgumentException
  */
 public function testGetActivitiesByChannelIdException()
 {
     $channelId = '';
     $response = $this->youtube->getActivitiesByChannelId($channelId);
 }