PluginProbe
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification / 5.5.0
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification v5.5.0
5.5.0 5.4.0 5.3.2 5.3.1 5.1.6 5.1.5 trunk 2.1.5 2.11 2.12 2.13 2.15 3.0.0 3.0.1 3.0.2 3.0.3 3.0.5 3.0.51 3.0.60 3.0.61 3.0.62 3.0.70 3.0.71 3.0.72 3.1.0 All 34 releases
double-opt-in / src / Events / Form / FormValidatedEvent.php

FormValidatedEvent.php in Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification 5.5.0, at src/Events/Form/FormValidatedEvent.php

81 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Form Validated Event
4 *
5 * @package Forge12\DoubleOptIn\Events\Form
6 * @since 4.0.0
7 */
8
9 namespace Forge12\DoubleOptIn\Events\Form;
10
11 use Forge12\DoubleOptIn\EventSystem\Event;
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 /**
18 * Class FormValidatedEvent
19 *
20 * Dispatched when form validation is complete.
21 */
22 class FormValidatedEvent extends Event {
23
24 private int $formId;
25 private string $formType;
26 private bool $isValid;
27 private array $errors;
28 private string $recipientEmail;
29
30 /**
31 * Constructor.
32 *
33 * @param int $formId The form ID.
34 * @param string $formType The form type.
35 * @param bool $isValid Whether validation passed.
36 * @param string $recipientEmail The extracted recipient email.
37 * @param array $errors Validation errors if any.
38 */
39 public function __construct(
40 int $formId,
41 string $formType,
42 bool $isValid,
43 string $recipientEmail,
44 array $errors = array()
45 ) {
46 parent::__construct();
47 $this->formId = $formId;
48 $this->formType = $formType;
49 $this->isValid = $isValid;
50 $this->recipientEmail = $recipientEmail;
51 $this->errors = $errors;
52 }
53
54 /**
55 * {@inheritdoc}
56 */
57 public static function getWordPressHookName(): string {
58 return 'f12_cf7_doubleoptin_form_validated';
59 }
60
61 public function getFormId(): int {
62 return $this->formId;
63 }
64
65 public function getFormType(): string {
66 return $this->formType;
67 }
68
69 public function isValid(): bool {
70 return $this->isValid;
71 }
72
73 public function getRecipientEmail(): string {
74 return $this->recipientEmail;
75 }
76
77 public function getErrors(): array {
78 return $this->errors;
79 }
80 }
81