PluginProbe ʕ •ᴥ•ʔ
Hostinger Reach – AI-Powered Email Marketing for WordPress / 1.7.0
Hostinger Reach – AI-Powered Email Marketing for WordPress v1.7.0
1.7.2 1.7.1 1.7.0 1.6.0 1.5.9 1.5.8 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 trunk 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6
hostinger-reach / vendor / woocommerce / action-scheduler / classes / migration / LogMigrator.php
hostinger-reach / vendor / woocommerce / action-scheduler / classes / migration Last commit date
ActionMigrator.php 10 months ago ActionScheduler_DBStoreMigrator.php 10 months ago BatchFetcher.php 10 months ago Config.php 10 months ago Controller.php 10 months ago DryRun_ActionMigrator.php 10 months ago DryRun_LogMigrator.php 10 months ago LogMigrator.php 10 months ago Runner.php 10 months ago Scheduler.php 10 months ago
LogMigrator.php
59 lines
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 * Source logger instance.
20 *
21 * @var ActionScheduler_Logger
22 */
23 private $source;
24
25 /**
26 * Destination logger instance.
27 *
28 * @var ActionScheduler_Logger
29 */
30 private $destination;
31
32 /**
33 * ActionMigrator constructor.
34 *
35 * @param ActionScheduler_Logger $source_logger Source logger object.
36 * @param ActionScheduler_Logger $destination_logger Destination logger object.
37 */
38 public function __construct( ActionScheduler_Logger $source_logger, ActionScheduler_Logger $destination_logger ) {
39 $this->source = $source_logger;
40 $this->destination = $destination_logger;
41 }
42
43 /**
44 * Migrate an action log.
45 *
46 * @param int $source_action_id Source logger object.
47 * @param int $destination_action_id Destination logger object.
48 */
49 public function migrate( $source_action_id, $destination_action_id ) {
50 $logs = $this->source->get_logs( $source_action_id );
51
52 foreach ( $logs as $log ) {
53 if ( absint( $log->get_action_id() ) === absint( $source_action_id ) ) {
54 $this->destination->log( $destination_action_id, $log->get_message(), $log->get_date() );
55 }
56 }
57 }
58 }
59