formData = $formData; $this->integrationId = $integrationId; } /** * {@inheritdoc} */ public static function getWordPressHookName(): string { return 'f12_cf7_doubleoptin_form_submission'; } /** * Get the form data. * * @return FormDataInterface */ public function getFormData(): FormDataInterface { return $this->formData; } /** * Set modified form data. * * @param FormDataInterface $formData The modified form data. * * @return void */ public function setFormData( FormDataInterface $formData ): void { $this->formData = $formData; } /** * Get the integration identifier. * * @return string */ public function getIntegrationId(): string { return $this->integrationId; } /** * Get the form ID. * * @return int */ public function getFormId(): int { return $this->formData->getFormId(); } /** * Get the form type. * * @return string */ public function getFormType(): string { return $this->formData->getFormType(); } /** * Skip the opt-in creation for this submission. * * @param string $reason Optional reason for skipping. * * @return void */ public function skipOptIn( string $reason = '' ): void { $this->skipOptIn = true; $this->skipReason = $reason; } /** * Check if opt-in should be skipped. * * @return bool True if opt-in should be skipped. */ public function shouldSkipOptIn(): bool { return $this->skipOptIn; } /** * Get the reason for skipping opt-in. * * @return string The skip reason. */ public function getSkipReason(): string { return $this->skipReason; } /** * Get a specific form field value. * * @param string $key The field name. * @param mixed $default Default value if field doesn't exist. * * @return mixed The field value. */ public function getField( string $key, $default = null ) { return $this->formData->getField( $key, $default ); } /** * Check if a form field exists. * * @param string $key The field name. * * @return bool True if field exists. */ public function hasField( string $key ): bool { return $this->formData->hasField( $key ); } }