| @@ 115-127 (lines=13) @@ | ||
| 112 | /** |
|
| 113 | * {@inheritdoc} |
|
| 114 | */ |
|
| 115 | public function getCount($videoManagerId, VideosRequestParameters $parameters = null) |
|
| 116 | { |
|
| 117 | $options = [ |
|
| 118 | self::OPT_VIDEO_MANAGER_ID => $videoManagerId, |
|
| 119 | ]; |
|
| 120 | ||
| 121 | if ($parameters) { |
|
| 122 | $options['query'] = $parameters->getContainer(); |
|
| 123 | } |
|
| 124 | ||
| 125 | $response = $this->makeRequest('GET', 'videos', $options); |
|
| 126 | ||
| 127 | return json_decode($response->getBody()->getContents(), true)['total']; |
|
| 128 | } |
|
| 129 | ||
| 130 | /** |
|
| @@ 216-233 (lines=18) @@ | ||
| 213 | /** |
|
| 214 | * {@inheritdoc} |
|
| 215 | */ |
|
| 216 | public function getVideo($videoManagerId, $videoId, VideoRequestParameters $parameters = null) |
|
| 217 | { |
|
| 218 | $options = [ |
|
| 219 | self::OPT_VIDEO_MANAGER_ID => $videoManagerId, |
|
| 220 | ]; |
|
| 221 | ||
| 222 | if ($parameters) { |
|
| 223 | $options['query'] = $parameters->getContainer(); |
|
| 224 | } |
|
| 225 | ||
| 226 | $response = $this->makeRequest( |
|
| 227 | 'GET', |
|
| 228 | sprintf('videos/%s', $videoId), |
|
| 229 | $options |
|
| 230 | ); |
|
| 231 | ||
| 232 | return $this->deserialize($response->getBody()->getContents(), Video::class); |
|
| 233 | } |
|
| 234 | ||
| 235 | /** |
|
| 236 | * {@inheritdoc} |
|