Ejemplo 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;
 }
Ejemplo n.º 2
0
 /**
  * @param Author-ID $email
  * @return Author
  */
 public function show($email)
 {
     return $this->authors->read($email);
 }