Ejemplo n.º 1
0
 public function handle(Command $command)
 {
     $request = $command->getRequest();
     $playlist = Playlist::create(uniqid(), $request->get('name'));
     $this->playlist_repository->add($playlist);
     return $playlist;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 3
0
 public function handle(Command $command)
 {
     $request = $command->getRequest();
     return $this->track_repository->getListByName($request->get('search_term'));
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 5
0
 public function handle(Command $command)
 {
     $request = $command->getRequest();
     return $this->artist_repository->get(new ArtistIdentity($request->get('id')));
 }