public function handle(DeleteAlbumCommand $command) { $album = $this->albumRepository->ofId($command->getAlbumId()); $this->albumRepository->remove($album); }
public function handle(CreateAlbumCommand $command) { $this->albumRepository->add(new Album($command->getTitle(), $command->getArtistId())); }
public function handle(ChangeNameCommand $command) { $album = $this->albumRepository->ofId($command->getId()); $album->changeTitleFor($command->getNewName()); }