@@ -150,13 +150,16 @@ public function searchAdvanced($params)
150
150
* @return \StdClass
151
151
* @throws \Exception
152
152
*/
153
- public function getChannelByName ($ username )
153
+ public function getChannelByName ($ username, $ optionalParams = false )
154
154
{
155
155
$ API_URL = $ this ->getApi ('channels.list ' );
156
156
$ params = array (
157
157
'forUsername ' => $ username ,
158
- 'part ' => 'id,snippet,contentDetails, statistics,topicDetails ,invideoPromotion '
158
+ 'part ' => 'id,snippet,contentDetails,statistics,invideoPromotion '
159
159
);
160
+ if ($ optionalParams ){
161
+ $ params = array_merge ($ params , $ optionalParams );
162
+ }
160
163
$ apiData = $ this ->api_get ($ API_URL , $ params );
161
164
return $ this ->decodeSingle ($ apiData );
162
165
}
@@ -166,13 +169,16 @@ public function getChannelByName($username)
166
169
* @return \StdClass
167
170
* @throws \Exception
168
171
*/
169
- public function getChannelById ($ id )
172
+ public function getChannelById ($ id, $ optionalParams = false )
170
173
{
171
174
$ API_URL = $ this ->getApi ('channels.list ' );
172
175
$ params = array (
173
176
'id ' => $ id ,
174
- 'part ' => 'id,snippet,contentDetails, statistics,topicDetails ,invideoPromotion '
177
+ 'part ' => 'id,snippet,contentDetails,statistics,invideoPromotion '
175
178
);
179
+ if ($ optionalParams ){
180
+ $ params = array_merge ($ params , $ optionalParams );
181
+ }
176
182
$ apiData = $ this ->api_get ($ API_URL , $ params );
177
183
return $ this ->decodeSingle ($ apiData );
178
184
}
0 commit comments