PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.5.1
JetFormBuilder — Dynamic Blocks Form Builder v3.6.5.1
3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / vendor / woocommerce / action-scheduler / classes / schedules / ActionScheduler_IntervalSchedule.php
jetformbuilder / vendor / woocommerce / action-scheduler / classes / schedules Last commit date
ActionScheduler_CanceledSchedule.php 1 year ago ActionScheduler_CronSchedule.php 1 year ago ActionScheduler_IntervalSchedule.php 1 year ago ActionScheduler_NullSchedule.php 1 year ago ActionScheduler_Schedule.php 1 year ago ActionScheduler_SimpleSchedule.php 1 year ago
ActionScheduler_IntervalSchedule.php
91 lines
1 <?php
2
3 /**
4 * Class ActionScheduler_IntervalSchedule
5 */
6 class ActionScheduler_IntervalSchedule extends ActionScheduler_Abstract_RecurringSchedule implements ActionScheduler_Schedule {
7
8 /**
9 * Deprecated property @see $this->__wakeup() for details.
10 *
11 * @var null
12 */
13 private $start_timestamp = null;
14
15 /**
16 * Deprecated property @see $this->__wakeup() for details.
17 *
18 * @var null
19 */
20 private $interval_in_seconds = null;
21
22 /**
23 * Calculate when this schedule should start after a given date & time using
24 * the number of seconds between recurrences.
25 *
26 * @param DateTime $after Timestamp.
27 * @return DateTime
28 */
29 protected function calculate_next( DateTime $after ) {
30 $after->modify( '+' . (int) $this->get_recurrence() . ' seconds' );
31 return $after;
32 }
33
34 /**
35 * Schedule interval in seconds.
36 *
37 * @return int
38 */
39 public function interval_in_seconds() {
40 _deprecated_function( __METHOD__, '3.0.0', '(int)ActionScheduler_Abstract_RecurringSchedule::get_recurrence()' );
41 return (int) $this->get_recurrence();
42 }
43
44 /**
45 * Serialize interval schedules with data required prior to AS 3.0.0
46 *
47 * Prior to Action Scheduler 3.0.0, recurring schedules used different property names to
48 * refer to equivalent data. For example, ActionScheduler_IntervalSchedule::start_timestamp
49 * was the same as ActionScheduler_SimpleSchedule::timestamp. Action Scheduler 3.0.0
50 * aligned properties and property names for better inheritance. To guard against the
51 * possibility of infinite loops if downgrading to Action Scheduler < 3.0.0, we need to
52 * also store the data with the old property names so if it's unserialized in AS < 3.0,
53 * the schedule doesn't end up with a null/false/0 recurrence.
54 *
55 * @return array
56 */
57 public function __sleep() {
58
59 $sleep_params = parent::__sleep();
60
61 $this->start_timestamp = $this->scheduled_timestamp;
62 $this->interval_in_seconds = $this->recurrence;
63
64 return array_merge(
65 $sleep_params,
66 array(
67 'start_timestamp',
68 'interval_in_seconds',
69 )
70 );
71 }
72
73 /**
74 * Unserialize interval schedules serialized/stored prior to AS 3.0.0
75 *
76 * For more background, @see ActionScheduler_Abstract_RecurringSchedule::__wakeup().
77 */
78 public function __wakeup() {
79 if ( is_null( $this->scheduled_timestamp ) && ! is_null( $this->start_timestamp ) ) {
80 $this->scheduled_timestamp = $this->start_timestamp;
81 unset( $this->start_timestamp );
82 }
83
84 if ( is_null( $this->recurrence ) && ! is_null( $this->interval_in_seconds ) ) {
85 $this->recurrence = $this->interval_in_seconds;
86 unset( $this->interval_in_seconds );
87 }
88 parent::__wakeup();
89 }
90 }
91