$stmt = $this->pdo->prepare( 'INSERT INTO event_store ( event_id, event_type, aggregate_id, payload, status, created_at ) VALUES (?, ?, ?, ?, ?, ?)' ); $stmt->execute([ Uuid::generate(), get_class($event), $event->aggregateId(), json_encode($event->toArray()), 'pending', // 未処理状態 new DateTimeImmutable() ]); } public function findUnprocessedEvents(int $limit = 100): array {} public function markAsProcessed(string $eventId): void {} } 29/34