コード例 #1
0
 public function handle(Command $command)
 {
     $request = $command->getRequest();
     $playlist = Playlist::create(uniqid(), $request->get('name'));
     $this->playlist_repository->add($playlist);
     return $playlist;
 }
コード例 #2
0
 public function handle(Command $command)
 {
     $request = $command->getRequest();
     $playlist = $this->playlist_repository->get(new PlaylistIdentity($request->get('id')));
     $this->updateName($playlist, $request->get('new_name'));
     $this->addTracks($playlist, $request->get('add_tracks'));
     $this->removeTracks($playlist, $request->get('remove_tracks'));
     $this->playlist_repository->add($playlist);
     return $playlist;
 }
コード例 #3
0
 public function handle(Command $command)
 {
     $request = $command->getRequest();
     return $this->track_repository->getListByName($request->get('search_term'));
 }
コード例 #4
0
 public function handle(Command $command)
 {
     $request = $command->getRequest();
     $playlist = $this->playlist_repository->get(new PlaylistIdentity($request->get('id')));
     $this->playlist_repository->remove($playlist);
 }
コード例 #5
0
 public function handle(Command $command)
 {
     $request = $command->getRequest();
     return $this->artist_repository->get(new ArtistIdentity($request->get('id')));
 }