/** * {@inheritdoc} */ public function find($id) { $recordedEvents = $this->eventStore->getEvents($id); $post = Post::instantiateForReconstitution(); $post->applyRecordedEvents($recordedEvents); return $post; }
/** * @param array $givens * * @return self */ public function given(array $givens = []) { if (!$givens) { $this->post = null; return $this; } /** @var Post|RecordsEvents|AppliesRecordedEvents $post */ $post = Post::instantiateForReconstitution(); $post->applyRecordedEvents($givens); $this->post = $post; return $this; }