surecart
/
vendor
/
woocommerce
/
action-scheduler
/
classes
/
schedules
/
ActionScheduler_NullSchedule.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_NullSchedule.php
32 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Class ActionScheduler_NullSchedule |
| 5 | */ |
| 6 | class ActionScheduler_NullSchedule extends ActionScheduler_SimpleSchedule { |
| 7 | |
| 8 | /** @var DateTime|null */ |
| 9 | protected $scheduled_date; |
| 10 | |
| 11 | /** |
| 12 | * Make the $date param optional and default to null. |
| 13 | * |
| 14 | * @param null $date The date & time to run the action. |
| 15 | */ |
| 16 | public function __construct( DateTime $date = null ) { |
| 17 | $this->scheduled_date = null; |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * This schedule has no scheduled DateTime, so we need to override the parent __sleep() |
| 22 | * @return array |
| 23 | */ |
| 24 | public function __sleep() { |
| 25 | return array(); |
| 26 | } |
| 27 | |
| 28 | public function __wakeup() { |
| 29 | $this->scheduled_date = null; |
| 30 | } |
| 31 | } |
| 32 |