PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / 1.5.02
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution v1.5.02
2.5.0 2.4.0 2.3.0 2.2.5 2.2.0 2.1.2 2.1.1 trunk 1.10.0 1.10.01 1.10.02 1.5.0 1.5.01 1.5.02 1.5.1 1.5.10 1.5.20 1.5.21 1.5.22 1.5.23 1.5.24 1.5.25 1.6.0 1.7.0 1.7.1 All 34 releases
fluent-booking / vendor / woocommerce / action-scheduler / classes / migration / LogMigrator.php

LogMigrator.php in Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution 1.5.02, 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