/var/www/html/wp-content/plugins/woocommerce/packages/action-scheduler/classes/migration/Config.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?php


namespace Action_Scheduler\Migration;

use 
Action_Scheduler\WP_CLI\ProgressBar;
use 
ActionScheduler_Logger as Logger;
use 
ActionScheduler_Store as Store;

/**
 * Class Config
 *
 * @package Action_Scheduler\Migration
 *
 * @since 3.0.0
 *
 * A config builder for the ActionScheduler\Migration\Runner class
 */
class Config {
    
/**
     * Source store instance.
     *
     * @var ActionScheduler_Store
     */
    
private $source_store;

    
/**
     * Source logger instance.
     *
     * @var ActionScheduler_Logger
     */
    
private $source_logger;

    
/**
     * Destination store instance.
     *
     * @var ActionScheduler_Store
     */
    
private $destination_store;

    
/**
     * Destination logger instance.
     *
     * @var ActionScheduler_Logger
     */
    
private $destination_logger;

    
/**
     * Progress bar object.
     *
     * @var Action_Scheduler\WP_CLI\ProgressBar
     */
    
private $progress_bar;

    
/**
     * Flag indicating a dryrun.
     *
     * @var bool
     */
    
private $dry_run false;

    
/**
     * Config constructor.
     */
    
public function __construct() {

    }

    
/**
     * Get the configured source store.
     *
     * @return ActionScheduler_Store
     * @throws \RuntimeException When source store is not configured.
     */
    
public function get_source_store() {
        if ( empty( 
$this->source_store ) ) {
            throw new 
\RuntimeException__'Source store must be configured before running a migration''woocommerce' ) );
        }

        return 
$this->source_store;
    }

    
/**
     * Set the configured source store.
     *
     * @param ActionScheduler_Store $store Source store object.
     */
    
public function set_source_storeStore $store ) {
        
$this->source_store $store;
    }

    
/**
     * Get the configured source logger.
     *
     * @return ActionScheduler_Logger
     * @throws \RuntimeException When source logger is not configured.
     */
    
public function get_source_logger() {
        if ( empty( 
$this->source_logger ) ) {
            throw new 
\RuntimeException__'Source logger must be configured before running a migration''woocommerce' ) );
        }

        return 
$this->source_logger;
    }

    
/**
     * Set the configured source logger.
     *
     * @param ActionScheduler_Logger $logger Logger object.
     */
    
public function set_source_loggerLogger $logger ) {
        
$this->source_logger $logger;
    }

    
/**
     * Get the configured destination store.
     *
     * @return ActionScheduler_Store
     * @throws \RuntimeException When destination store is not configured.
     */
    
public function get_destination_store() {
        if ( empty( 
$this->destination_store ) ) {
            throw new 
\RuntimeException__'Destination store must be configured before running a migration''woocommerce' ) );
        }

        return 
$this->destination_store;
    }

    
/**
     * Set the configured destination store.
     *
     * @param ActionScheduler_Store $store Action store object.
     */
    
public function set_destination_storeStore $store ) {
        
$this->destination_store $store;
    }

    
/**
     * Get the configured destination logger.
     *
     * @return ActionScheduler_Logger
     * @throws \RuntimeException When destination logger is not configured.
     */
    
public function get_destination_logger() {
        if ( empty( 
$this->destination_logger ) ) {
            throw new 
\RuntimeException__'Destination logger must be configured before running a migration''woocommerce' ) );
        }

        return 
$this->destination_logger;
    }

    
/**
     * Set the configured destination logger.
     *
     * @param ActionScheduler_Logger $logger Logger object.
     */
    
public function set_destination_loggerLogger $logger ) {
        
$this->destination_logger $logger;
    }

    
/**
     * Get flag indicating whether it's a dry run.
     *
     * @return bool
     */
    
public function get_dry_run() {
        return 
$this->dry_run;
    }

    
/**
     * Set flag indicating whether it's a dry run.
     *
     * @param bool $dry_run Dry run toggle.
     */
    
public function set_dry_run$dry_run ) {
        
$this->dry_run = (bool) $dry_run;
    }

    
/**
     * Get progress bar object.
     *
     * @return ActionScheduler\WPCLI\ProgressBar
     */
    
public function get_progress_bar() {
        return 
$this->progress_bar;
    }

    
/**
     * Set progress bar object.
     *
     * @param ActionScheduler\WPCLI\ProgressBar $progress_bar Progress bar object.
     */
    
public function set_progress_barProgressBar $progress_bar ) {
        
$this->progress_bar $progress_bar;
    }
}