surecart
/
vendor
/
woocommerce
/
action-scheduler
/
classes
/
schedules
/
ActionScheduler_CanceledSchedule.php
ActionScheduler_CanceledSchedule.php
3 years ago
ActionScheduler_CronSchedule.php
3 years ago
ActionScheduler_IntervalSchedule.php
3 years ago
ActionScheduler_NullSchedule.php
3 years ago
ActionScheduler_Schedule.php
3 years ago
ActionScheduler_SimpleSchedule.php
3 years ago
ActionScheduler_CanceledSchedule.php
58 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Class ActionScheduler_SimpleSchedule |
| 5 | */ |
| 6 | class ActionScheduler_CanceledSchedule extends ActionScheduler_SimpleSchedule { |
| 7 | |
| 8 | /** |
| 9 | * Deprecated property @see $this->__wakeup() for details. |
| 10 | **/ |
| 11 | private $timestamp = NULL; |
| 12 | |
| 13 | /** |
| 14 | * @param DateTime $after |
| 15 | * |
| 16 | * @return DateTime|null |
| 17 | */ |
| 18 | public function calculate_next( DateTime $after ) { |
| 19 | return null; |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * Cancelled actions should never have a next schedule, even if get_next() |
| 24 | * is called with $after < $this->scheduled_date. |
| 25 | * |
| 26 | * @param DateTime $after |
| 27 | * @return DateTime|null |
| 28 | */ |
| 29 | public function get_next( DateTime $after ) { |
| 30 | return null; |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * @return bool |
| 35 | */ |
| 36 | public function is_recurring() { |
| 37 | return false; |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Unserialize recurring schedules serialized/stored prior to AS 3.0.0 |
| 42 | * |
| 43 | * Prior to Action Scheduler 3.0.0, schedules used different property names to refer |
| 44 | * to equivalent data. For example, ActionScheduler_IntervalSchedule::start_timestamp |
| 45 | * was the same as ActionScheduler_SimpleSchedule::timestamp. Action Scheduler 3.0.0 |
| 46 | * aligned properties and property names for better inheritance. To maintain backward |
| 47 | * compatibility with schedules serialized and stored prior to 3.0, we need to correctly |
| 48 | * map the old property names with matching visibility. |
| 49 | */ |
| 50 | public function __wakeup() { |
| 51 | if ( ! is_null( $this->timestamp ) ) { |
| 52 | $this->scheduled_timestamp = $this->timestamp; |
| 53 | unset( $this->timestamp ); |
| 54 | } |
| 55 | parent::__wakeup(); |
| 56 | } |
| 57 | } |
| 58 |