PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 2.8.16
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v2.8.16
3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 All 261 releases
wpfunnels / packages / action-scheduler / classes / migration / LogMigrator.php

LogMigrator.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 2.8.16, at packages/action-scheduler/classes/migration/LogMigrator.php

54 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3
4 namespace Action_Scheduler\Migration;
5
6 use ActionScheduler_Logger;
7
8 /**
9 * Class LogMigrator
10 *
11 * @package Action_Scheduler\Migration
12 *
13 * @since 3.0.0
14 *
15 * @codeCoverageIgnore
16 */
17 class LogMigrator {
18 /**
19 * @var ActionScheduler_Logger
20 */
21 private $source;
22
23 /**
24 * @var ActionScheduler_Logger
25 */
26 private $destination;
27
28 /**
29 * ActionMigrator constructor.
30 *
31 * @param ActionScheduler_Logger $source_logger Source logger object.
32 * @param ActionScheduler_Logger $destination_Logger Destination logger object.
33 */
34 public function __construct( ActionScheduler_Logger $source_logger, ActionScheduler_Logger $destination_Logger ) {
35 $this->source = $source_logger;
36 $this->destination = $destination_Logger;
37 }
38
39 /**
40 * Migrate an action log.
41 *
42 * @param int $source_action_id Source logger object.
43 * @param int $destination_action_id Destination logger object.
44 */
45 public function migrate( $source_action_id, $destination_action_id ) {
46 $logs = $this->source->get_logs( $source_action_id );
47 foreach ( $logs as $log ) {
48 if ( $log->get_action_id() == $source_action_id ) {
49 $this->destination->log( $destination_action_id, $log->get_message(), $log->get_date() );
50 }
51 }
52 }
53 }
54