Пример #1
0
 /**
  * Process the payload.
  * @param Collection $payload
  * @return Collection
  */
 public function process($payload)
 {
     $dataCollection = $payload;
     if ($dataCollection->has('series')) {
         $seriesId = $dataCollection->get('series')->playlist_id;
         $videos = $this->videoService->getVideosInPlaylist($seriesId);
         $dataCollection = $dataCollection->put('videos', $videos);
     }
     return $dataCollection;
 }
Пример #2
0
 private function getPlaylistVideos($playlists)
 {
     return $playlists->map(function ($item) {
         return ['series' => $item->id, 'videos' => $this->videoService->getVideosInPlaylist($item->playlist_id)];
     });
 }