Exemplo n.º 1
0
 public function handleWritePost(WritePost $command)
 {
     $author = $this->authors->read($command->getAuthor());
     $post = new Post(time() . '_' . preg_replace('/[^a-zA-Z0-9]/', '', $command->getTitle()), $author->getEmail(), $command->getTitle(), $command->getText());
     $post->setPublished($command->getPublished());
     $post->setTags($command->getTags());
     $this->posts->create($post);
     return $post;
 }