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