mailpoet
/
vendor
/
woocommerce
/
action-scheduler
/
classes
/
schedules
/
ActionScheduler_SimpleSchedule.php
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
index.php
3 years ago
ActionScheduler_SimpleSchedule.php
29 lines
| 1 | <?php |
| 2 | if (!defined('ABSPATH')) exit; |
| 3 | class ActionScheduler_SimpleSchedule extends ActionScheduler_Abstract_Schedule { |
| 4 | private $timestamp = null; |
| 5 | public function calculate_next( DateTime $after ) { |
| 6 | return null; |
| 7 | } |
| 8 | public function is_recurring() { |
| 9 | return false; |
| 10 | } |
| 11 | public function __sleep() { |
| 12 | $sleep_params = parent::__sleep(); |
| 13 | $this->timestamp = $this->scheduled_timestamp; |
| 14 | return array_merge( |
| 15 | $sleep_params, |
| 16 | array( |
| 17 | 'timestamp', |
| 18 | ) |
| 19 | ); |
| 20 | } |
| 21 | public function __wakeup() { |
| 22 | if ( is_null( $this->scheduled_timestamp ) && ! is_null( $this->timestamp ) ) { |
| 23 | $this->scheduled_timestamp = $this->timestamp; |
| 24 | unset( $this->timestamp ); |
| 25 | } |
| 26 | parent::__wakeup(); |
| 27 | } |
| 28 | } |
| 29 |