$data */ public static function fromArray(array $data): self { return new self( title: $data['title'], label: $data['label'] ?? null, description: $data['description'] ?? null, mediaType: $data['media_type'] ?? 'image', image: $data['image'] ?? null, videoUrl: $data['video_url'] ?? null, mobileVideoUrl: $data['mobile_video_url'] ?? null, mobileImage: $data['mobile_image'] ?? null, buttonText: $data['button_text'] ?? null, buttonUrl: $data['button_url'] ?? null, orderIndex: $data['order_index'] ?? 0, isActive: $data['is_active'] ?? true, ); } /** * @return array */ public function toArray(): array { return [ 'label' => $this->label, 'title' => $this->title, 'description' => $this->description, 'media_type' => $this->mediaType, 'image' => $this->image, 'video_url' => $this->videoUrl, 'mobile_video_url' => $this->mobileVideoUrl, 'mobile_image' => $this->mobileImage, 'button_text' => $this->buttonText, 'button_url' => $this->buttonUrl, 'order_index' => $this->orderIndex, 'is_active' => $this->isActive, ]; } }