/** * @param SearchPlayListsCommandResult $commandResult * * @return PlayList */ private function getFirstPlayList(SearchPlayListsCommandResult $commandResult) { $playLists = $commandResult->playLists(); return reset($playLists); }
/** * @param Command|SearchPlayListsCommand $command * * @return mixed */ public function handle(Command $command) { $playLists = $this->playListRepository->findAll(); return $this->searchPlayListsCommandResultDataTransformer->transform(SearchPlayListsCommandResult::instance($playLists)); }