File "LogMigrator.php"

Full Path: /home/warrior1/public_html/wp-content-20241001222009/plugins/mailpoet/vendor/woocommerce/action-scheduler/classes/migration/LogMigrator.php
File size: 670 bytes
MIME-type: text/x-php
Charset: utf-8

<?php
namespace Action_Scheduler\Migration;
if (!defined('ABSPATH')) exit;
use ActionScheduler_Logger;
class LogMigrator {
 private $source;
 private $destination;
 public function __construct( ActionScheduler_Logger $source_logger, ActionScheduler_Logger $destination_Logger ) {
 $this->source = $source_logger;
 $this->destination = $destination_Logger;
 }
 public function migrate( $source_action_id, $destination_action_id ) {
 $logs = $this->source->get_logs( $source_action_id );
 foreach ( $logs as $log ) {
 if ( $log->get_action_id() == $source_action_id ) {
 $this->destination->log( $destination_action_id, $log->get_message(), $log->get_date() );
 }
 }
 }
}