/** * @param UserWasRegistered $event */ public function onUserWasRegistered(UserWasRegistered $event) { $this->connection->insert(Table::USER, ['id' => $event->userId()->toString(), 'name' => $event->name(), 'email' => $event->emailAddress()->toString()]); }
/** * @param UserWasRegistered $event */ protected function whenUserWasRegistered(UserWasRegistered $event) { $this->userId = $event->userId(); $this->name = $event->name(); $this->emailAddress = $event->emailAddress(); }