PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.2.0
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.2.0
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
image-optimization / vendor / woocommerce / action-scheduler / classes / migration / LogMigrator.php

LogMigrator.php in Image Optimizer – Compress Images and Convert to WebP or AVIF 1.2.0, at vendor/woocommerce/action-scheduler/classes/migration/LogMigrator.php

50 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 /** @var ActionScheduler_Logger */
19 private $source;
20
21 /** @var ActionScheduler_Logger */
22 private $destination;
23
24 /**
25 * ActionMigrator constructor.
26 *
27 * @param ActionScheduler_Logger $source_logger Source logger object.
28 * @param ActionScheduler_Logger $destination_Logger Destination logger object.
29 */
30 public function __construct( ActionScheduler_Logger $source_logger, ActionScheduler_Logger $destination_Logger ) {
31 $this->source = $source_logger;
32 $this->destination = $destination_Logger;
33 }
34
35 /**
36 * Migrate an action log.
37 *
38 * @param int $source_action_id Source logger object.
39 * @param int $destination_action_id Destination logger object.
40 */
41 public function migrate( $source_action_id, $destination_action_id ) {
42 $logs = $this->source->get_logs( $source_action_id );
43 foreach ( $logs as $log ) {
44 if ( $log->get_action_id() == $source_action_id ) {
45 $this->destination->log( $destination_action_id, $log->get_message(), $log->get_date() );
46 }
47 }
48 }
49 }
50