PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.7
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.7
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Services / Libraries / action-scheduler / classes / schedules / ActionScheduler_SimpleSchedule.php

ActionScheduler_SimpleSchedule.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 6.2.7, at app/Services/Libraries/action-scheduler/classes/schedules/ActionScheduler_SimpleSchedule.php

82 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Class ActionScheduler_SimpleSchedule
5 */
6 class ActionScheduler_SimpleSchedule extends ActionScheduler_Abstract_Schedule {
7
8 /**
9 * Deprecated property @see $this->__wakeup() for details.
10 *
11 * @var null|DateTime
12 */
13 private $timestamp = null;
14
15 /**
16 * Calculate when this schedule should start after a given date & time using
17 * the number of seconds between recurrences.
18 *
19 * @param DateTime $after Timestamp.
20 *
21 * @return DateTime|null
22 */
23 public function calculate_next( DateTime $after ) {
24 return null;
25 }
26
27 /**
28 * Schedule is not recurring.
29 *
30 * @return bool
31 */
32 public function is_recurring() {
33 return false;
34 }
35
36 /**
37 * Serialize schedule with data required prior to AS 3.0.0
38 *
39 * Prior to Action Scheduler 3.0.0, schedules used different property names to refer
40 * to equivalent data. For example, ActionScheduler_IntervalSchedule::start_timestamp
41 * was the same as ActionScheduler_SimpleSchedule::timestamp. Action Scheduler 3.0.0
42 * aligned properties and property names for better inheritance. To guard against the
43 * scheduled date for single actions always being seen as "now" if downgrading to
44 * Action Scheduler < 3.0.0, we need to also store the data with the old property names
45 * so if it's unserialized in AS < 3.0, the schedule doesn't end up with a null recurrence.
46 *
47 * @return array
48 */
49 public function __sleep() {
50
51 $sleep_params = parent::__sleep();
52
53 $this->timestamp = $this->scheduled_timestamp;
54
55 return array_merge(
56 $sleep_params,
57 array(
58 'timestamp',
59 )
60 );
61 }
62
63 /**
64 * Unserialize recurring schedules serialized/stored prior to AS 3.0.0
65 *
66 * Prior to Action Scheduler 3.0.0, schedules used different property names to refer
67 * to equivalent data. For example, ActionScheduler_IntervalSchedule::start_timestamp
68 * was the same as ActionScheduler_SimpleSchedule::timestamp. Action Scheduler 3.0.0
69 * aligned properties and property names for better inheritance. To maintain backward
70 * compatibility with schedules serialized and stored prior to 3.0, we need to correctly
71 * map the old property names with matching visibility.
72 */
73 public function __wakeup() {
74
75 if ( is_null( $this->scheduled_timestamp ) && ! is_null( $this->timestamp ) ) {
76 $this->scheduled_timestamp = $this->timestamp;
77 unset( $this->timestamp );
78 }
79 parent::__wakeup();
80 }
81 }
82