', '>=', '<', '<=', '=') ) ) { return $comparison_operator; } return '='; } /** * Get the time MySQL formated date/time string for an action's (next) scheduled date. * * @param ActionScheduler_Action $action * @param DateTime $scheduled_date (optional) * @return string */ protected function get_scheduled_date_string( ActionScheduler_Action $action, DateTime $scheduled_date = NULL ) { $next = null === $scheduled_date ? $action->get_schedule()->next() : $scheduled_date; if ( ! $next ) { throw new InvalidArgumentException( __( 'Invalid schedule. Cannot save action.', 'woocommerce' ) ); } $next->setTimezone( new DateTimeZone( 'UTC' ) ); return $next->format( 'Y-m-d H:i:s' ); } /** * Get the time MySQL formated date/time string for an action's (next) scheduled date. * * @param ActionScheduler_Action $action * @param DateTime $scheduled_date (optional) * @return string */ protected function get_scheduled_date_string_local( ActionScheduler_Action $action, DateTime $scheduled_date = NULL ) { $next = null === $scheduled_date ? $action->get_schedule()->next() : $scheduled_date; if ( ! $next ) { throw new InvalidArgumentException( __( 'Invalid schedule. Cannot save action.', 'woocommerce' ) ); } ActionScheduler_TimezoneHelper::set_local_timezone( $next ); return $next->format( 'Y-m-d H:i:s' ); } /** * @return array */ public function get_status_labels() { return array( self::STATUS_COMPLETE => __( 'Complete', 'woocommerce' ), self::STATUS_PENDING => __( 'Pending', 'woocommerce' ), self::STATUS_RUNNING => __( 'In-progress', 'woocommerce' ), self::STATUS_FAILED => __( 'Failed', 'woocommerce' ), self::STATUS_CANCELED => __( 'Canceled', 'woocommerce' ), ); } public function init() {} /** * @return ActionScheduler_Store */ public static function instance() { if ( empty(self::$store) ) { $class = apply_filters('action_scheduler_store_class', 'ActionScheduler_wpPostStore'); self::$store = new $class(); } return self::$store; } /** * Get the site's local time. * * @deprecated 2.1.0 * @return DateTimeZone */ protected function get_local_timezone() { _deprecated_function( __FUNCTION__, '2.1.0', 'ActionScheduler_TimezoneHelper::set_local_timezone()' ); return ActionScheduler_TimezoneHelper::get_local_timezone(); } }