PluginProbe
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments / 3.4.1
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments v3.4.1
4.7.2 4.7.1 4.7.0 4.6.6 4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.1 4.5.0 4.4.2 4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.3 4.2.2 4.2.1 1.0.3 1.0.4 1.0.5 All 281 releases
surecart / app / src / Sync / SyncServiceProvider.php
SyncServiceProvider.php
61 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SureCart\Sync;
4
5 use SureCart\Sync\CollectionSyncService;
6 use SureCart\Sync\CustomerSyncService;
7 use SureCart\Sync\PostSyncService;
8 use SureCart\Sync\ProductSyncService;
9 use SureCart\Sync\ProductsSyncProcess;
10 use SureCart\Sync\ProductsSyncService;
11 use SureCart\Sync\StoreSyncService;
12 use SureCartCore\ServiceProviders\ServiceProviderInterface;
13
14 /**
15 * WordPress Users service.
16 */
17 class SyncServiceProvider implements ServiceProviderInterface {
18 /**
19 * Register all dependencies in the IoC container.
20 *
21 * @param \Pimple\Container $container Service container.
22 * @return void
23 */
24 public function register( $container ) {
25 $app = $container[ SURECART_APPLICATION_KEY ];
26
27 $container['surecart.sync'] = fn ( $container ) =>
28 new SyncService( $container[ SURECART_APPLICATION_KEY ] );
29
30 $container['surecart.sync.store'] = fn ( $container ) =>
31 new StoreSyncService( $container[ SURECART_APPLICATION_KEY ] );
32
33 $container['surecart.sync.product'] = fn ( $container ) =>
34 new ProductSyncService( $container[ SURECART_APPLICATION_KEY ] );
35
36 $container['surecart.sync.collection'] = fn() => new CollectionSyncService();
37 $container['surecart.process.product_post.sync'] = fn() => new PostSyncService();
38 $container['surecart.sync.customers'] = fn() => new CustomerSyncService();
39 $container['surecart.sync.products'] = fn() => new ProductsSyncService( $container[ SURECART_APPLICATION_KEY ] );
40
41 // Queues up the products for syncing and starts sync.
42 $products_queue_process = new ProductsSyncProcess();
43 $container['surecart.process.products.queue'] = fn() => $products_queue_process;
44
45 $app->alias( 'sync', 'surecart.sync' );
46 }
47
48 /**
49 * Bootstrap any services if needed.
50 *
51 * @param \Pimple\Container $container Service container.
52 * @return void
53 */
54 public function bootstrap( $container ) {
55 $container['surecart.sync.product']->bootstrap();
56 $container['surecart.sync.products']->bootstrap();
57 $container['surecart.sync.customers']->bootstrap();
58 $container['surecart.sync.store']->bootstrap();
59 }
60 }
61