Passed
Push — development ( 5c1522...f7b72f )
by Theodoros
03:50
created

EcondaConfig   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 4
Bugs 0 Features 0
Metric Value
dl 0
loc 45
rs 10
c 4
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFileExportPath() 0 3 1
A getHostYves() 0 3 1
A getPdoEcondaQueryClassName() 0 16 2
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 Exception;
11
use Spryker\Shared\Application\ApplicationConstants;
12
use Spryker\Zed\Kernel\AbstractBundleConfig;
13
use SprykerEco\Shared\Econda\EcondaConstants;
14
15
class EcondaConfig extends AbstractBundleConfig
16
{
17
    const ECONDA_CSV_DELIMITER = '|';
18
    const ECONDA_CSV_CATEGORY_DELIMITER = '^^';
19
20
    /**
21
     * @return string
22
     */
23
    public function getHostYves()
24
    {
25
        return $this->get(ApplicationConstants::HOST_YVES);
26
    }
27
28
    /**
29
     * @return string
30
     */
31
    public function getFileExportPath()
32
    {
33
        return $this->get(EcondaConstants::ECONDA_CSV_FOLDER_PATH);
34
    }
35
36
    /**
37
     * @param string $pdoEcondaQueryName
38
     * @param string $dbEngineName
39
     *
40
     * @throws \Exception
41
     *
42
     * @return string
43
     */
44
    public function getPdoEcondaQueryClassName($pdoEcondaQueryName, $dbEngineName)
45
    {
46
        $data = [
47
            'MySql' => [
48
49
            ],
50
            'PostgreSql' => [
51
52
            ],
53
        ];
54
55
        if (!isset($data[$dbEngineName][$pdoEcondaQueryName])) {
56
            throw new Exception('Invalid PdoEcondaQueryName name: ' . $pdoEcondaQueryName);
57
        }
58
59
        return $data[$dbEngineName][$pdoEcondaQueryName];
60
    }
61
}
62