|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* MIT License |
|
5
|
|
|
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file. |
|
6
|
|
|
*/ |
|
7
|
|
|
|
|
8
|
|
|
namespace SprykerEco\Zed\Econda; |
|
9
|
|
|
|
|
10
|
|
|
use Spryker\Zed\Kernel\AbstractBundleDependencyProvider; |
|
11
|
|
|
use Spryker\Zed\Kernel\Container; |
|
12
|
|
|
use SprykerEco\Zed\Econda\Communication\Plugin\CategoryExporterPlugin; |
|
13
|
|
|
use SprykerEco\Zed\Econda\Communication\Plugin\ProductExporterPlugin; |
|
14
|
|
|
use SprykerEco\Zed\Econda\Dependency\Facade\EcondaToLocaleFacadeBridge; |
|
15
|
|
|
use SprykerEco\Zed\Econda\Dependency\Facade\EcondaToPriceProductFacadeBridge; |
|
16
|
|
|
use SprykerEco\Zed\Econda\Dependency\Facade\EcondaToPropelFacadeBridge; |
|
17
|
|
|
|
|
18
|
|
|
class EcondaDependencyProvider extends AbstractBundleDependencyProvider |
|
19
|
|
|
{ |
|
20
|
|
|
public const FACADE_LOCALE = 'FACADE_LOCALE'; |
|
21
|
|
|
public const FACADE_PROPEL = 'FACADE_PROPEL'; |
|
22
|
|
|
public const FACADE_PRICE_PRODUCT = 'FACADE_PRICE_PRODUCT'; |
|
23
|
|
|
public const QUERY_CONTAINER_PRODUCT_IMAGE = 'QUERY_CONTAINER_PRODUCT_IMAGE'; |
|
24
|
|
|
public const QUERY_CONTAINER_PRODUCT_CATEGORY = 'QUERY_CONTAINER_PRODUCT_CATEGORY'; |
|
25
|
|
|
public const FILE_PLUGINS = 'FILE_PLUGINS'; |
|
26
|
|
|
public const PRODUCTS_PLUGIN = 'ProductsPlugin'; |
|
27
|
|
|
public const CATEGORIES_PLUGIN = 'CategoryPlugin'; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* @param \Spryker\Zed\Kernel\Container $container |
|
31
|
|
|
* |
|
32
|
|
|
* @return \Spryker\Zed\Kernel\Container |
|
33
|
|
|
*/ |
|
34
|
|
|
public function provideBusinessLayerDependencies(Container $container): Container |
|
35
|
|
|
{ |
|
36
|
|
|
$container->set(static::FACADE_LOCALE, function (Container $container) { |
|
37
|
|
|
return new EcondaToLocaleFacadeBridge($container->getLocator()->locale()->facade()); |
|
38
|
|
|
}); |
|
39
|
|
|
|
|
40
|
|
|
$container->set(static::FACADE_PROPEL, function (Container $container) { |
|
41
|
|
|
return new EcondaToPropelFacadeBridge($container->getLocator()->propel()->facade()); |
|
42
|
|
|
}); |
|
43
|
|
|
|
|
44
|
|
|
$container->set(static::FACADE_PRICE_PRODUCT, function (Container $container) { |
|
45
|
|
|
return new EcondaToPriceProductFacadeBridge($container->getLocator()->priceProduct()->facade()); |
|
46
|
|
|
}); |
|
47
|
|
|
|
|
48
|
|
|
$container->set(static::QUERY_CONTAINER_PRODUCT_IMAGE, function (Container $container) { |
|
49
|
|
|
return $container->getLocator()->productImage()->queryContainer(); |
|
50
|
|
|
}); |
|
51
|
|
|
|
|
52
|
|
|
$container->set(static::QUERY_CONTAINER_PRODUCT_CATEGORY, function (Container $container) { |
|
53
|
|
|
return $container->getLocator()->productCategory()->queryContainer(); |
|
54
|
|
|
}); |
|
55
|
|
|
|
|
56
|
|
|
$container->set(static::FILE_PLUGINS, $this->getFilePlugins()); |
|
57
|
|
|
|
|
58
|
|
|
return $container; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* @return array |
|
63
|
|
|
*/ |
|
64
|
|
|
public function getFilePlugins(): array |
|
65
|
|
|
{ |
|
66
|
|
|
return [ |
|
67
|
|
|
static::PRODUCTS_PLUGIN => new ProductExporterPlugin(), |
|
68
|
|
|
static::CATEGORIES_PLUGIN => new CategoryExporterPlugin(), |
|
69
|
|
|
]; |
|
70
|
|
|
} |
|
71
|
|
|
} |
|
72
|
|
|
|