Пример #1
0
 public function applyPostWritten(PostWritten $event)
 {
     $this->id = $event->PostId();
     $this->title = $event->title();
     $this->content = $event->content();
     $this->type = $event->type();
 }
 public function whenPostWritten(PostWritten $event)
 {
     $post = new PostList($event->postId(), new MemberId('6703202d-6556-404d-988c-b76c5a34b97c'), $event->title(), $event->content(), $event->type(), new DateTimeImmutable('2016-09-02T10:14:05'));
     $this->posts->save($post);
 }