public function whenPostPublishedAt(PostPublishedAt $event) { $post = $this->posts->find($event->postId()); $this->posts->save(new PostList($post->id(), $post->authorId(), $post->title(), $post->content(), $post->type(), $event->publishedAt())); }