/** * @param TodoWasPosted $event */ protected function whenTodoWasPosted(TodoWasPosted $event) { $this->todoId = $event->todoId(); $this->assigneeId = $event->assigneeId(); $this->text = $event->text(); $this->status = $event->todoStatus(); }
/** * @param TodoWasPosted $event */ public function onTodoWasPosted(TodoWasPosted $event) { $this->connection->insert(Table::TODO, ['id' => $event->todoId()->toString(), 'assignee_id' => $event->assigneeId()->toString(), 'text' => $event->text(), 'status' => $event->todoStatus()->toString()]); }