$this->eventId, 'name' => $this->name, 'type' => $this->type, 'discount_type' => $this->discountType, 'discount_value' => $this->discountValue, 'total_discount' => $this->totalDiscount, 'applied_items' => $this->appliedItems, ]; } /** * 배열에서 DTO를 생성합니다. * * @param array $data 배열 데이터 */ public static function fromArray(array $data): self { return new self( eventId: $data['event_id'] ?? 0, name: $data['name'] ?? '', type: $data['type'] ?? '', discountType: $data['discount_type'] ?? '', discountValue: $data['discount_value'] ?? 0, totalDiscount: $data['total_discount'] ?? 0, appliedItems: $data['applied_items'] ?? null, ); } }