PluginProbe ʕ •ᴥ•ʔ
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin / 3.11.0
WP Mail SMTP by WPForms – The Most Popular SMTP and Email Log Plugin v3.11.0
4.9.0 0.9.6 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.6.0 1.6.2 1.7.0 1.7.1 1.8.0 1.8.1 1.9.0 2.0.0 2.0.1 2.1.1 2.2.1 2.3.1 2.4.0 2.5.0 2.5.1 2.6.0 2.7.0 2.8.0 2.9.0 3.0.1 3.0.2 3.0.3 3.1.0 3.10.0 3.11.0 3.11.1 3.2.0 3.2.1 3.3.0 3.4.0 3.5.0 3.5.1 3.5.2 3.6.1 3.7.0 3.8.0 3.8.2 3.9.0 4.0.1 4.1.0 4.1.1 4.2.0 4.3.0 4.4.0 4.5.0 4.6.0 4.7.0 4.7.1 4.8.0 trunk 0.10.0 0.10.1 0.11.1 0.11.2 0.3.1 0.3.2 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.5.2 0.6 0.7 0.8 0.8.2 0.8.3 0.8.4 0.8.5 0.8.6 0.8.7 0.9.0 0.9.1 0.9.2 0.9.3 0.9.4 0.9.5
wp-mail-smtp / vendor / woocommerce / action-scheduler / classes / abstracts / ActionScheduler_Abstract_Schedule.php
wp-mail-smtp / vendor / woocommerce / action-scheduler / classes / abstracts Last commit date
ActionScheduler.php 2 years ago ActionScheduler_Abstract_ListTable.php 2 years ago ActionScheduler_Abstract_QueueRunner.php 2 years ago ActionScheduler_Abstract_RecurringSchedule.php 2 years ago ActionScheduler_Abstract_Schedule.php 2 years ago ActionScheduler_Abstract_Schema.php 2 years ago ActionScheduler_Lock.php 2 years ago ActionScheduler_Logger.php 2 years ago ActionScheduler_Store.php 2 years ago ActionScheduler_TimezoneHelper.php 2 years ago
ActionScheduler_Abstract_Schedule.php
84 lines
1 <?php
2
3 /**
4 * Class ActionScheduler_Abstract_Schedule
5 */
6 abstract class ActionScheduler_Abstract_Schedule extends ActionScheduler_Schedule_Deprecated {
7
8 /**
9 * The date & time the schedule is set to run.
10 *
11 * @var DateTime
12 */
13 private $scheduled_date = NULL;
14
15 /**
16 * Timestamp equivalent of @see $this->scheduled_date
17 *
18 * @var int
19 */
20 protected $scheduled_timestamp = NULL;
21
22 /**
23 * @param DateTime $date The date & time to run the action.
24 */
25 public function __construct( DateTime $date ) {
26 $this->scheduled_date = $date;
27 }
28
29 /**
30 * Check if a schedule should recur.
31 *
32 * @return bool
33 */
34 abstract public function is_recurring();
35
36 /**
37 * Calculate when the next instance of this schedule would run based on a given date & time.
38 *
39 * @param DateTime $after
40 * @return DateTime
41 */
42 abstract protected function calculate_next( DateTime $after );
43
44 /**
45 * Get the next date & time when this schedule should run after a given date & time.
46 *
47 * @param DateTime $after
48 * @return DateTime|null
49 */
50 public function get_next( DateTime $after ) {
51 $after = clone $after;
52 if ( $after > $this->scheduled_date ) {
53 $after = $this->calculate_next( $after );
54 return $after;
55 }
56 return clone $this->scheduled_date;
57 }
58
59 /**
60 * Get the date & time the schedule is set to run.
61 *
62 * @return DateTime|null
63 */
64 public function get_date() {
65 return $this->scheduled_date;
66 }
67
68 /**
69 * For PHP 5.2 compat, since DateTime objects can't be serialized
70 * @return array
71 */
72 public function __sleep() {
73 $this->scheduled_timestamp = $this->scheduled_date->getTimestamp();
74 return array(
75 'scheduled_timestamp',
76 );
77 }
78
79 public function __wakeup() {
80 $this->scheduled_date = as_get_datetime_object( $this->scheduled_timestamp );
81 unset( $this->scheduled_timestamp );
82 }
83 }
84