public function handle($command) { $article = $this->articleRepository->getById($command->articleId); $comment = $article->placeComment($command->author, $command->content); $this->articleRepository->save($article); return new CommentOnArticleResponse($article, $comment); }
public function handle($command) { $article = $this->articleRepository->getById($command->articleId); $article->unpublish(); $this->articleRepository->save($article); return new UnpublishArticleResponse($article); }
public function handle($command) { $article = $this->articleRepository->getById($command->articleId); $this->articleRepository->delete($article); return new DeleteArticleResponse($article); }