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 / Config.php

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

181 lines 3.7 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 Action_Scheduler\WP_CLI\ProgressBar;
7 use ActionScheduler_Logger as Logger;
8 use ActionScheduler_Store as Store;
9
10 /**
11 * Class Config
12 *
13 * @package Action_Scheduler\Migration
14 *
15 * @since 3.0.0
16 *
17 * A config builder for the ActionScheduler\Migration\Runner class
18 */
19 class Config {
20 /**
21 * @var ActionScheduler_Store
22 */
23 private $source_store;
24
25 /**
26 * @var ActionScheduler_Logger
27 */
28 private $source_logger;
29
30 /**
31 * @var ActionScheduler_Store
32 */
33 private $destination_store;
34
35 /**
36 * @var ActionScheduler_Logger
37 */
38 private $destination_logger;
39
40 /**
41 * @var Progress bar
42 */
43 private $progress_bar;
44
45 /**
46 * @var bool
47 */
48 private $dry_run = false;
49
50 /**
51 * Config constructor.
52 */
53 public function __construct() {
54
55 }
56
57 /**
58 * Get the configured source store.
59 *
60 * @return ActionScheduler_Store
61 */
62 public function get_source_store() {
63 if ( empty( $this->source_store ) ) {
64 throw new \RuntimeException( __( 'Source store must be configured before running a migration', 'woocommerce' ) );
65 }
66
67 return $this->source_store;
68 }
69
70 /**
71 * Set the configured source store.
72 *
73 * @param ActionScheduler_Store $store Source store object.
74 */
75 public function set_source_store( Store $store ) {
76 $this->source_store = $store;
77 }
78
79 /**
80 * Get the configured source loger.
81 *
82 * @return ActionScheduler_Logger
83 */
84 public function get_source_logger() {
85 if ( empty( $this->source_logger ) ) {
86 throw new \RuntimeException( __( 'Source logger must be configured before running a migration', 'woocommerce' ) );
87 }
88
89 return $this->source_logger;
90 }
91
92 /**
93 * Set the configured source logger.
94 *
95 * @param ActionScheduler_Logger $logger
96 */
97 public function set_source_logger( Logger $logger ) {
98 $this->source_logger = $logger;
99 }
100
101 /**
102 * Get the configured destination store.
103 *
104 * @return ActionScheduler_Store
105 */
106 public function get_destination_store() {
107 if ( empty( $this->destination_store ) ) {
108 throw new \RuntimeException( __( 'Destination store must be configured before running a migration', 'woocommerce' ) );
109 }
110
111 return $this->destination_store;
112 }
113
114 /**
115 * Set the configured destination store.
116 *
117 * @param ActionScheduler_Store $store
118 */
119 public function set_destination_store( Store $store ) {
120 $this->destination_store = $store;
121 }
122
123 /**
124 * Get the configured destination logger.
125 *
126 * @return ActionScheduler_Logger
127 */
128 public function get_destination_logger() {
129 if ( empty( $this->destination_logger ) ) {
130 throw new \RuntimeException( __( 'Destination logger must be configured before running a migration', 'woocommerce' ) );
131 }
132
133 return $this->destination_logger;
134 }
135
136 /**
137 * Set the configured destination logger.
138 *
139 * @param ActionScheduler_Logger $logger
140 */
141 public function set_destination_logger( Logger $logger ) {
142 $this->destination_logger = $logger;
143 }
144
145 /**
146 * Get flag indicating whether it's a dry run.
147 *
148 * @return bool
149 */
150 public function get_dry_run() {
151 return $this->dry_run;
152 }
153
154 /**
155 * Set flag indicating whether it's a dry run.
156 *
157 * @param bool $dry_run
158 */
159 public function set_dry_run( $dry_run ) {
160 $this->dry_run = (bool) $dry_run;
161 }
162
163 /**
164 * Get progress bar object.
165 *
166 * @return ActionScheduler\WPCLI\ProgressBar
167 */
168 public function get_progress_bar() {
169 return $this->progress_bar;
170 }
171
172 /**
173 * Set progress bar object.
174 *
175 * @param ActionScheduler\WPCLI\ProgressBar $progress_bar
176 */
177 public function set_progress_bar( ProgressBar $progress_bar ) {
178 $this->progress_bar = $progress_bar;
179 }
180 }
181