Madcoda\Youtube\Youtube::getChannelByName PHP Method

getChannelByName() public method

public getChannelByName ( $username, $optionalParams = false ) : StdClass
$username
return StdClass
    public function getChannelByName($username, $optionalParams = false)
    {
        $API_URL = $this->getApi('channels.list');
        $params = array('forUsername' => $username, 'part' => 'id,snippet,contentDetails,statistics,invideoPromotion');
        if ($optionalParams) {
            $params = array_merge($params, $optionalParams);
        }
        $apiData = $this->api_get($API_URL, $params);
        return $this->decodeSingle($apiData);
    }