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\FactFinderSdk; |
9
|
|
|
|
10
|
|
|
use Spryker\Zed\Kernel\AbstractBundleConfig; |
11
|
|
|
use SprykerEco\Shared\FactFinderSdk\FactFinderSdkConstants; |
12
|
|
|
|
13
|
|
|
class FactFinderSdkConfig extends AbstractBundleConfig implements FactFinderSdkConfigInterface |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* @uses \Spryker\Shared\Application\ApplicationConstants::HOST_YVES |
17
|
|
|
*/ |
18
|
|
|
protected const HOST_YVES = 'HOST_YVES'; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* @api |
22
|
|
|
* |
23
|
|
|
* @return string |
24
|
|
|
*/ |
25
|
|
|
public function getEnvironment() |
26
|
|
|
{ |
27
|
|
|
return $this->get(FactFinderSdkConstants::ENVIRONMENT); |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @api |
32
|
|
|
* |
33
|
|
|
* @return array |
34
|
|
|
*/ |
35
|
|
|
public function getFactFinderConfiguration() |
36
|
|
|
{ |
37
|
|
|
return $this->get(FactFinderSdkConstants::ENVIRONMENT . $this->getEnvironment()); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @api |
42
|
|
|
* |
43
|
|
|
* @return mixed[] |
44
|
|
|
*/ |
45
|
|
|
public function getFactFinderProductionConfiguration(): array |
46
|
|
|
{ |
47
|
|
|
return $this->get(sprintf( |
48
|
|
|
'%s%s', |
49
|
|
|
FactFinderSdkConstants::ENVIRONMENT, |
50
|
|
|
FactFinderSdkConstants::ENVIRONMENT_PRODUCTION |
51
|
|
|
)); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @api |
56
|
|
|
* |
57
|
|
|
* @return string |
58
|
|
|
*/ |
59
|
|
|
public function getCsvDirectory() |
60
|
|
|
{ |
61
|
|
|
return $this->get(FactFinderSdkConstants::CSV_DIRECTORY); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @api |
66
|
|
|
* |
67
|
|
|
* @return int |
68
|
|
|
*/ |
69
|
|
|
public function getExportQueryLimit() |
70
|
|
|
{ |
71
|
|
|
return $this->get(FactFinderSdkConstants::EXPORT_QUERY_LIMIT); |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @api |
76
|
|
|
* |
77
|
|
|
* @return string |
78
|
|
|
*/ |
79
|
|
|
public function getExportFileNamePrefix() |
80
|
|
|
{ |
81
|
|
|
return $this->get(FactFinderSdkConstants::EXPORT_FILE_NAME_PREFIX); |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @api |
86
|
|
|
* |
87
|
|
|
* @return string |
88
|
|
|
*/ |
89
|
|
|
public function getExportFileNameDelimiter() |
90
|
|
|
{ |
91
|
|
|
return $this->get(FactFinderSdkConstants::EXPORT_FILE_NAME_DELIMITER); |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @api |
96
|
|
|
* |
97
|
|
|
* @return string |
98
|
|
|
*/ |
99
|
|
|
public function getExportFileExtension() |
100
|
|
|
{ |
101
|
|
|
return $this->get(FactFinderSdkConstants::EXPORT_FILE_EXTENSION); |
102
|
|
|
} |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @api |
106
|
|
|
* |
107
|
|
|
* @return string |
108
|
|
|
*/ |
109
|
|
|
public function getYvesHost() |
110
|
|
|
{ |
111
|
|
|
return $this->get(static::HOST_YVES); |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* @api |
116
|
|
|
* |
117
|
|
|
* @return array |
118
|
|
|
*/ |
119
|
|
|
public function getItemFields() |
120
|
|
|
{ |
121
|
|
|
return $this->get(FactFinderSdkConstants::ITEM_FIELDS); |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* @api |
126
|
|
|
* |
127
|
|
|
* @return int |
128
|
|
|
*/ |
129
|
|
|
public function getCategoriesMaxCount() |
130
|
|
|
{ |
131
|
|
|
return $this->get(FactFinderSdkConstants::CATEGORIES_MAX_COUNT); |
132
|
|
|
} |
133
|
|
|
} |
134
|
|
|
|