timestamp = $timestamp ?? Timestamp::now(); } /** * Check if this event is for a specific entity class */ public function isEntityOfType(string $expectedClass): bool { return $this->entityClass === $expectedClass || $this->entity instanceof $expectedClass; } /** * Get event metadata */ public function getEventData(): array { return [ 'event_type' => 'entity_deleted', 'entity_class' => $this->entityClass, 'entity_id' => $this->entityId, 'timestamp' => $this->timestamp->toFloat(), 'deleted_data' => $this->deletedData, ]; } }