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 / Lifecycle / OptInExpiredEvent.php

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

68 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * OptIn Expired Event
4 *
5 * @package Forge12\DoubleOptIn\Events\Lifecycle
6 * @since 4.0.0
7 */
8
9 namespace Forge12\DoubleOptIn\Events\Lifecycle;
10
11 use Forge12\DoubleOptIn\EventSystem\Event;
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 /**
18 * Class OptInExpiredEvent
19 *
20 * @api
21 *
22 * Dispatched when opt-in records are cleaned up by the cron job.
23 * Covered by the Addon API semver policy as of Core API 4.3.0.
24 */
25 class OptInExpiredEvent extends Event {
26
27 private string $cleanupType;
28 private int $rowsDeleted;
29 private \DateTimeImmutable $threshold;
30
31 /**
32 * Constructor.
33 *
34 * @param string $cleanupType The type: 'confirmed' or 'unconfirmed'.
35 * @param int $rowsDeleted Number of records deleted.
36 * @param \DateTimeImmutable $threshold The cutoff date/time.
37 */
38 public function __construct(
39 string $cleanupType,
40 int $rowsDeleted,
41 \DateTimeImmutable $threshold
42 ) {
43 parent::__construct();
44 $this->cleanupType = $cleanupType;
45 $this->rowsDeleted = $rowsDeleted;
46 $this->threshold = $threshold;
47 }
48
49 /**
50 * {@inheritdoc}
51 */
52 public static function getWordPressHookName(): string {
53 return 'f12_cf7_doubleoptin_expired';
54 }
55
56 public function getCleanupType(): string {
57 return $this->cleanupType;
58 }
59
60 public function getRowsDeleted(): int {
61 return $this->rowsDeleted;
62 }
63
64 public function getThreshold(): \DateTimeImmutable {
65 return $this->threshold;
66 }
67 }
68